Tools used:
Microsoft Visual Studio team System 2008 (Express)
Web SQL Server express 2005
Step 1:
Right-click the app_code folder, select "Add new item...", and select dataset. The dataset name does not matter, but you must keep it in mind.
Step 2:
Right-click the XSD form and select "add, tableadapter... "
Step 3:
Wait a few seconds and the "choose your data connection" form appears. Select or create a connection and click "Next ".
Step 4:
Here is the key: on the "choose a command type" form, select "create new stored procedures" and click "next ."
Step 5:
Enter an SQL SELECT statement for a single table and click "next ."
Step 6:
The "create the Stored Procedures" form appears. Rename the stored procedure as a meaningful Name:
Step 7:
You can see the "Wizard results" form and click "finish" multiple times to create the stored procedure.
Step 8:
Delete the. XSD File Created in step 1 from the app_code directory. This step is not necessary:
You can see the stored procedure in SQL Server Management studio.
The generated stored procedure is very clear and you can modify it as needed. This is more convenient than self-writing.