Click to See Complete Forum and Search --> : Ado.net using IDBCommand


jaineeshthakur
February 26th, 2008, 11:17 PM
How can I use the stored procedure with the help of IDBCommand to save my new record in the database.

jaineeshthakur
February 26th, 2008, 11:21 PM
Please send me the answer with example using IDBCommand.

Shuja Ali
February 27th, 2008, 01:14 AM
How can I use the stored procedure with the help of IDBCommand to save my new record in the database.
Your question is somewhat incomplete. What database are you talking about? And how are you connecting to this database. What does this stored procedure return?

zdavis
March 13th, 2008, 01:56 PM
I think you could probably do something like this.....



string connectionString = <your Connection String>;
//Right here your connection type could be anything OleDb, Odbc, etc
IDbConnection conn = new SqlConnection(connectionString);
IDbCommand cmd = conn.CreateCommand();
cmd.CommandText = <your Stored Procedure>;
cmd.CommandType = CommandType.StoreProcedure;
//Add your parameters to the stored procedure
cmd.ExecuteNonQuery();



Is that what you are looking for????