The original Published time: 2008-07-25--from my Baidu article [imported by moving tools]
1. Right-click on App_Data to add a SQL database
2. Double-click the database, add the table to the left, and display the table data for adding data
3. Drag and drop the table you just created into the open page in Design view.
At this point, Visual Studio automatically creates a GridView that is bound to the SqlDataSource Control. And you'll also see that the Web. config has a connection string! You can change the name of the concatenated string to be remembered, as in this case with Testconn.
4. Finally you can remove the SqlDataSource control and the GridView control
5, now you can use this connection string to connect App_Data inside the database!!! As follows:
SqlConnection testconn = new SqlConnection (configurationmanager.connectionstrings["Testconn"]. ConnectionString);
Create a database in App_Data easy way to get a connection string!