How can I use the stored procedure with the help of IDBCommand to save my new record in the database.
Printable View
How can I use the stored procedure with the help of IDBCommand to save my new record in the database.
Please send me the answer with example using IDBCommand.
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?Quote:
Originally Posted by jaineeshthakur
I think you could probably do something like this.....
Is that what you are looking for????Code:
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();