|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can anyone please help me figure out what each of the parameters in this function mean
ADODB.Recordset_Command.Execute(out Object RecordsAffected, ref objParameters ,int options) I am trying to query an Active Directory using c# in asp.net After connecting to the active directory. I am unable to execute this command which retreives the data from the active directory. Execute method is supposed to return a record set, But i am unable to figure out the parameters of Execute method Code: ADODB.Connection Conn=new ADODB.Connection(); ADODB.Recordset rs=new ADODB.RecordsetClass(); Conn.Provider="ADsDSOObject"; ADODB.Command cmd=new ADODB.Command(); Conn.Open("Active Directory Provider",null,null,0); cmd.ActiveConnection=Conn; i have also specified the command text. rs=cmd.Execute(?,?,?) Can any one help me with this Thank you |
|
#2
|
|||
|
|||
|
The Answer from France
Try to use this code to execute your command !
object dummy = Type.Missing; ADODB.Recordset rs = cmd.Execute(out dummy, ref dummy, 0); OML is everywhere ! |
|
#3
|
|||
|
|||
|
This worked for me
ADODB.Recordset objRS = null;
try { ADODB.Connection objConn = new ADODB.Connection(); int intConnectionMode = (int)ConnectModeEnum.adModeUnknown; objConn.Open("Provider='SQLOLEDB';Data Source='MyServer'; Initial Catalog='MyDataBase';", UserName, Password, intConnectionMode); objConn.CursorLocation = ADODB.CursorLocationEnum.adUseClient; object objRecAff; ADODB.Command cmd = new ADODB.Command(); cmd.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc; cmd.ActiveConnection = objConn; cmd.CommandTimeout = 600; cmd.CommandText = "MyStoredProcName"; cmd.Parameters.Refresh(); cmd.Parameters["@employeeID"].Value = 68; cmd.Parameters["@startDate"].Value = "1/1/2008"; cmd.Parameters["@DaysToGet"].Value = 30; object objParameters = cmd.Parameters; objRS = (ADODB.Recordset)cmd.Execute(out objRecAff, ref objParameters, (int)ADODB.CommandTypeEnum.adCmdStoredProc); } catch (Exception e) { Console.WriteLine(e.Message); } return objRS; } |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Using Adodb.Command.Execute Method in C# and ASp.net |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|