Running a stored procedure in a SqlDataSource on button click
- by Gapton
I am building a C# ASP.NET page where I want to call a stored procedure in a database.
I have setup a SqlDataSource which points to the stored procedure. Parameters are obtained from the Web's control directly (TextBox)
I have a button, when the user clicks it it should run the stored procedure, so I was going to add code like this :
mySqlDataSource.run()
or
mySqlDataSource.exec()
or
mySqlDataSource.storedProcedure()
but of course none of these methods exist.
How do I initial the stored procedure? and how do I get the value returned by the stored procedure please?
Thank you!