Open() Dim cmd As New Sql Command("Select * from stores", con) Dim da As New Sql Data Adapter(cmd) Dim ds As New Data Set() da.
Page Private con As New Sql Connection("Data Source=.; Initial Catalog=pubs; User ID=sa; Password=*****") Protected Sub Page_Load(By Val sender As Object, By Val e As System. Load If Not Is Post Back Then load Stores() End If End Sub Protected Sub load Stores() con.
The project files are also attached with this article so please feel free to download them.
I am using Template Field’s Item Template and Edit Item Template for providing read only and editing interface of the same column in the Grid View.Please keep in mind that there are many different ways to update the database using the Grid View control depending on the type of data you are updating and the functionality the user need and there are many solutions to achieve the same end result.In the above tutorial I tried to give you one of the easiest solutions and I hope you can go explore Grid View control editing further after learning the basics from this tutorial. Find Control("txtaddress"), Text Box) Dim city As Text Box = Direct Cast(grid View. Find Control("txtcity"), Text Box) Dim state As Text Box = Direct Cast(grid View.