Problem Updating DB

G

Guest

I am trying to update a single row after a link in the datagrid is clicked,
here's the code:

Dim SelectedIndex As TableRow = e.Item
'Dim Index As String = SelectedIndex
Dim ID As TableCell = SelectedIndex.Cells(0)
Dim CellText = ID.Text.ToString()
Dim FoundRow(0) As DataRow
FoundRow = DataSet1.Tables("QueueMembers").Select("CustomerId = '" &
CellText & "'")

If FoundRow.Length = 1 Then
Dim StatusUpdate As DataRow = FoundRow(0)
StatusUpdate("Status") = "Complete"
Me.SqlDataAdapter1.Update(DataSet1, "QueueMembers")
Else
Label1.Text = "None"
End If

The problem is it is updating every row not just the one selected in the
datagrid.

Any ideas?

Thanks, Justin.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top