I enjoyed with your great effort
This is a discussion on How do you call a stored procedure? within the Programming forums, part of the Web Designing & Development category; Create a command object, set the object’s CommandText property to the name of the stored procedure, and set the CommandType ...
Create a command object, set the object’s CommandText property to the name of the stored procedure, and set the CommandType property to StoredProcedure. To execute the stored procedure, use the command object’s ExecuteNonQuery, ExcecuteScalar, ExecuteReader, or ExecutelXmlReader method. For example, the following code calls the Ten Most Expensive Products stored procedure on the Northwind Traders database:
// Create a connection for NorthWind Trader's database.
SqlConnection connNWind = new SqlConnection("integrated security=SSPI;" +
"data source=(local);initial catalog=Northwind");
// Create a command object to execute.
SqlCommand cmdTopTen = new SqlCommand(connNWind);
cmdTopTen.CommandText = "Ten Most Expensive Products";
// Set the command properties.
cmdTopTen.CommandType = CommandType.StoredProcedure;
// Create a data reader object to get the results.
SqlDataReader drdTopTen;
// Open the connection.
connNWind.Open();
// Excecute the stored procedure.
drdTopTen = cmdTopTen.ExecuteReader();
I enjoyed with your great effort
:cool:الجياش:cool:
Thank you for u supported me...........
Hi,
Thank you that you shared the your experience.
Thank you..
Really such a nice info to call a stored procedure.. Thanks for sharing
Hello,
I have gone through your post and you have explained the stored procedure perfectly. Thanks for sharing such informative post.
Thanks a lot for sharing your knowledge..............
thank you very much
Bookmarks