Updating database using vb net
Our Grid View is now ready for Updating/Editing & Deleting. Have a look below: Note: Now you can Edit & Delete data from your page which rquires just few clicks. Declare the below five variables within page scope.
For this example i use the below table named tbl Supplier: Note: To test the example insert some test data into the above table. Now from the dropdown menu select the connectionstring “Test Connection”: Now click on next. Then click on advance and check Generate Insert, Update, and Delete statements checkbox.
In the last Template column headed by Action I added a Button with Command Name property=New. So first we need catch the click event of Add Supplier button. But questions are how we can identify which button user pressed to fire this event? So the Grid View1_Row Command() method code is: C# Code: Protected Sub Grid View1_Row Command(sender As Object, e As System.
Gridview gives us an event to resolve such type of problem.
Insert() End If End Sub The Command Name “Empty New” i will discuss later in this post.
Sql Parameter("Code", Sql Db Type.[Char], 6) Private Name As New System.
Search for updating database using vb net: