M
MFRASER
Can somone please help me. I am trying to get a ADO recordset and build a
dataset off of the recordset. I have tried both recordset.Open and
command.execute. I have not been successful.
Here is my code
ADODB.ConnectionClass Conn = new ADODB.ConnectionClass();
ADODB.CommandClass cmd = new ADODB.CommandClass();
//create ADODB Recordset object
ADODB.RecordsetClass rs= new ADODB.RecordsetClass();
cmd.ActiveConnection = Conn;
cmd.CommandText = SQL;
cmd.CommandType = ADODB.CommandTypeEnum.adCmdText;
cmd.CommandTimeout = 1200;
//I am using an in house dialect
cmd.Dialect = "{2BDA0E41-4A58-4721-BC09-6670511BC530}";
//execute the query specifying static sursor, batch optimistic locking
ADODB.ParameterClass Params = new ADODB.ParameterClass();
object rsTemp = (object)rs;
object Temp = (object)Params;
object tmpObj = new object();
//Does not work
rs.Open(cmd, tmpObj
,ADODB.CursorTypeEnum.adOpenUnspecified,ADODB.LockTypeEnum.adLockUnspecified
, -1);
//Does not work
cmd.Execute(out tmpObj, ref Temp,0);
dataset off of the recordset. I have tried both recordset.Open and
command.execute. I have not been successful.
Here is my code
ADODB.ConnectionClass Conn = new ADODB.ConnectionClass();
ADODB.CommandClass cmd = new ADODB.CommandClass();
//create ADODB Recordset object
ADODB.RecordsetClass rs= new ADODB.RecordsetClass();
cmd.ActiveConnection = Conn;
cmd.CommandText = SQL;
cmd.CommandType = ADODB.CommandTypeEnum.adCmdText;
cmd.CommandTimeout = 1200;
//I am using an in house dialect
cmd.Dialect = "{2BDA0E41-4A58-4721-BC09-6670511BC530}";
//execute the query specifying static sursor, batch optimistic locking
ADODB.ParameterClass Params = new ADODB.ParameterClass();
object rsTemp = (object)rs;
object Temp = (object)Params;
object tmpObj = new object();
//Does not work
rs.Open(cmd, tmpObj
,ADODB.CursorTypeEnum.adOpenUnspecified,ADODB.LockTypeEnum.adLockUnspecified
, -1);
//Does not work
cmd.Execute(out tmpObj, ref Temp,0);