I was trying to connect via Oracle Standard Edition and it seems the only way to connect is to use Direct = True to go with the SID/Service Name. What do I need to do to make the connection string as simple as possible, as shown in the first C# example at:
http://www.devart.com/dotconnect/oracle ... tring.html
Am trying to use the ExecuteArray, and read that ExecuteArray with Direct = True don't work all that well.
Must be a Oracle server configuration issue to make the above work?
Thanks,
-rob
Direct = True always required?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
You can use two modes when establish a connection:
1. OCI mode - requires Oracle Client installed on the deployment computer. The minimal set off the connection string parameters that you should set for establishing a connection:
2. Direct mode - does not require Oracle Client installed on the deployment computer. The minimal set off the connection string parameters that you should set for establishing a connection:
The ExecuteArray method is supported in direct mode. Information in the documentation is a bit outdated. We will update the documentation about the ExecuteArray method support in Direct mode soon.
1. OCI mode - requires Oracle Client installed on the deployment computer. The minimal set off the connection string parameters that you should set for establishing a connection:
Code: Select all
OracleConnection conn = new OracleConnection();
conn.Server = "***";
conn.UserId = "***";
conn.Password = "***";
conn.Open();
Code: Select all
OracleConnection conn = new OracleConnection();
conn.Server = "***";
conn.UserId = "***";
conn.Password = "***";
conn.Direct = true;
conn.Sid = "***";
conn.Port = 1521; //If your server uses 1521 port, this is the default value, used by dotConnect for Oracle and you don't need to specify conn.Port = 1521;
conn.Open();
Thanks for your help! Passed that point. Now ExecuteArray just sticks there, it doesn't move anywhere beyond that point, no errors or any feedback. Here's the code used:
Code: Select all
private void BuildLocationOracleArray(OracleCommand cmd, List list)
{
cmd.CommandText =
@"INSERT INTO ""StagingTable"" VALUES(:id, :address, :cityId, :dateCreated, :dateModified)";
cmd.Parameters.Add("id", OracleDbType.Integer);
cmd.Parameters.Add("address", OracleDbType.VarChar, 200);
cmd.Parameters.Add("cityId", OracleDbType.Integer);
cmd.Parameters.Add("dateCreated", OracleDbType.Date);
cmd.Parameters.Add("dateModified", OracleDbType.Date);
cmd.Parameters["id"].Value = list.Select(item => item.Id).ToArray();
cmd.Parameters["address"].Value = list.Select(item => item.Address).ToArray();
cmd.Parameters["cityId"].Value = list.Select(item => item.CityId).ToArray();
cmd.Parameters["dateCreated"].Value = list.Select(item => item.DateCreated).ToArray();
cmd.Parameters["dateModified"].Value = list.Select(item => item.DateModified).ToArray();
cmd.ExecuteArray(list.Count); // code stops here when hitting breakpoint, would not continue.
cmd.Dispose();
}
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Direct = True always required?
Please send us your DDL script for creating the table "StagingTable". We would also appreciate a small test project.
Please, also specify the Oracle server version.
Please, also specify the Oracle server version.