- 1). Click “Start,” “All Programs” and “Visual Studio” to open the program. Click “File” and “New Website” to open the “New Website” dialog. Select “Visual Basic” as the programming language and select “ASP.NET Website.” Select “File Systems” on the “Web Location” box and specify the folder where you want to store your website. Click “OK.”
- 2). Right-click “Data Connections” on the “Server Explorer.” Click “Add Connection.” Select “SQL Server Database File” on the “Data Source” list. Select “.NET Framework Data Provider for SQL Server” on the “Data Provider” list. Click “OK.”
- 3). Click "Browse" when the database name field comes up. Replace the database name with your actual database name. Check the “Save My Password” checkbox and click “OK.”
- 4). Click “Default.aspx” and switch to the design view. Click the “GridView” control in the toolbox and drag it to the blank area of the form. The “GridView Tasks” icon will appear after you add a GridView control to the form. Click the "GridView Tasks” icon and select a “New Data Source” on the “Choose Data Source” box. Click "Next." Click “Database” on the “Data Source Configuration” wizard.
- 5). Select a data table in the “Specify Columns from a Table or View.” Check your selected columns’ checkboxes under “Columns.”
- 6). Click “Advanced” and select “Generate INSERT, UPDATE and DELETE Statements” checkbox. Click “OK.” This will generate SQL statements for the data view control. Click “Next,” then “Finish.” The GridView control will show the chosen columns in the specific data text field.
next post