M
Mullin Yu
I got object reference not set, is the connection string wrong? Indeed, I
know int values should be pass to Open() and Execute() method, but don't
know the parameter variable given by .net.
Any help?
// dsn: system dsn
// database: is the database instance used
string connectionString = "dsn=ccbsdb;database=testdb";
String strSQL = "INSERT INTO Outbound (JobID, XMLRequest, DMCUserID,
SubmissionUserID, Priority, OutboundType) " +
"VALUES( 111, 'XML Request', 'DMCUserID', 'SubmissionUserID', 1, 2 );";
// Create the command object
ADODB.Command cmdAdder = new ADODB.CommandClass();
cmdAdder.ActiveConnection.Open(connectionString, "sa", "ccbs", 1);
// Start transaction
cmdAdder.ActiveConnection.BeginTrans();
// Execute the SQL command
cmdAdder.CommandText = strSQL;
object rs = new object();
object objParam = new Object();
// Insert into OutboundQueueItem
cmdAdder.Execute(out rs, ref objParam , 1);
// commit transaction
cmdAdder.ActiveConnection.CommitTrans();
know int values should be pass to Open() and Execute() method, but don't
know the parameter variable given by .net.
Any help?
// dsn: system dsn
// database: is the database instance used
string connectionString = "dsn=ccbsdb;database=testdb";
String strSQL = "INSERT INTO Outbound (JobID, XMLRequest, DMCUserID,
SubmissionUserID, Priority, OutboundType) " +
"VALUES( 111, 'XML Request', 'DMCUserID', 'SubmissionUserID', 1, 2 );";
// Create the command object
ADODB.Command cmdAdder = new ADODB.CommandClass();
cmdAdder.ActiveConnection.Open(connectionString, "sa", "ccbs", 1);
// Start transaction
cmdAdder.ActiveConnection.BeginTrans();
// Execute the SQL command
cmdAdder.CommandText = strSQL;
object rs = new object();
object objParam = new Object();
// Insert into OutboundQueueItem
cmdAdder.Execute(out rs, ref objParam , 1);
// commit transaction
cmdAdder.ActiveConnection.CommitTrans();