First you have to create a new web project as we discussed earlier article. How to create new project with visual studio. Watch Video
After create the new project, open a aspx form with design mode. select the Toolbox,
Go to data category and drag the Gridview control to form. Selecting the right side top corner arrow. you can see a popup window with selecting place for Data source
Select your Data Source Type - SQL Database and you can have a name for it.
Next step is to Select your connection type. This step is doing onetime for project. (Creating New connection). from the next time when you are creating Data Source, you have to select the created Connection.
Click on New connection button, popup window will come
Select Microsoft SQL Server and as the Data Provider select .Net Framework Data Provider for SQL Server.
Select or type the SQL server for Serer name drop down box.
Select or enter a Database name
For testing click the test connection button. and if connection is ok, press the ok button.
Connection will create with SQL selected database and you can see the tables in the database.
Now you can select the Table which you are need to bind with Gridview, also select the fields need to show with Griview.
Customizing the Griview you can watch with Video Chick here
0 comments:
Post a Comment