how to write a stored procedure that gets the content present in the table to a data grid.
I need to get all information from the table to a data grid by using a stored procedure
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mahesh ChandPosted Nov 27, 2006, 3:41 PM
Connect to the database using Server Explorer in Visual Studio, go to the database, expand it, click on Stored Procedures, Right click on Stored Procedures and select New Stored Procedure option. Then write your SQL statement and save it.
After that you execute SP as a SQL statement. Once you execute a SP, you will get data in a DataSet or DataReader and you can bind a DataSet using DataGrid.DataSource property.
See ADO.NET section for more details.
If you do not know how to create stored procedures, then use MSDN or SQL Books/Documentation to create SPs.