Updating in gridview

Rated 3.97/5 based on 831 customer reviews

I converted the "Categories" column to a template field, and populated it with a dropdown box that pulls the names from my Categories table (and it works surprisingly :)), but just doesn't update. Yes, that's why I wanted to see your Update parameters, because, as I suspected, there's no Control Parameter that passes the selected value of the dropdownlist.

I'd be happy to post more of my code if it would help you out, I just didn't want to flood my post with code that wasn't relevant to the problem. Hence, the Update statement has no idea where to get the @Category value from. Yes, that's why I wanted to see your Update parameters, because, as I suspected, there's no Control Parameter that passes the selected value of the dropdownlist.

" End If End Sub Protected Sub grid View_Row Data Bound(By Val sender As Object, By Val e As Grid View Row Event Args) If e.

Data Item, "stor_id")) Dim lnkbtnresult As Button = Direct Cast(e. Find Control("Button Delete"), Button) If lnkbtnresult Is Not Nothing Then lnkbtnresult.

" End If End Sub Protected Sub grid View_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) grid View. New Edit Index load Stores() End Sub Protected Sub grid View_Row Updating(By Val sender As Object, By Val e As Grid View Update Event Args) Dim stor_id As String = grid View.

Data Bind() Dim columncount As Integer = grid View.

Find Control("txtcity"), Text Box) Dim state As Text Box = Direct Cast(grid View.

Find Control("txtstate"), Text Box) Dim zip As Text Box = Direct Cast(grid View.

To String("javascript:return delete Confirm('") & stor_id) "')") End If End If End Sub Protected Sub grid View_Row Command(By Val sender As Object, By Val e As Grid View Command Event Args) If e. Equals("Add New") Then Dim instorid As Text Box = Direct Cast(grid View. Find Control("instorid"), Text Box) Dim inname As Text Box = Direct Cast(grid View. Find Control("inname"), Text Box) Dim inaddress As Text Box = Direct Cast(grid View. Find Control("inaddress"), Text Box) Dim incity As Text Box = Direct Cast(grid View. Find Control("incity"), Text Box) Dim instate As Text Box = Direct Cast(grid View. Find Control("instate"), Text Box) Dim inzip As Text Box = Direct Cast(grid View.

Open() Dim cmd As New Sql Command("insert into stores(stor_id,stor_name,stor_address,city,state,zip) values('" instorid.

Leave a Reply