Imports System.Data.SqlClient Imports System.Data Public Class _Default Inherits System.Web.UI.Page 'Declare ADO.Net objects Private conn As SqlConnection Private da As SqlDataAdapter Private ds As System.Data.DataSet Private cb As SqlCommandBuilder Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Create connection to Northwind database Dim conn As SqlConnection = New SqlConnection("Data Source=.;Initial Catalog=Northwind;Integrated Security=TRUE") 'Create a SQL statement to get rows from the customers table Dim queryString As String = "SELECT CustomerID, CompanyName FROM dbo.Customers" 'Create data adapter using the connection da = New SqlDataAdapter(queryString, conn) ds = New System.Data.DataSet 'Fill the dataset using the data adapter da.Fill(ds, "Customers") ds.Tables(0).Columns(1).ToString() 'Bind the grid to the dataset GridView1.DataSource = ds.Tables("Customers") GridView1.DataBind() End Sub Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'TODO Complete update code 'Create an update command using the command builder cb = New SqlCommandBuilder(da) da.UpdateCommand = cb.GetUpdateCommand() 'Update the database using the data adapter da.Update(ds.Tables("Customers")) End Sub End Class