Updating a database??????
Posted on 2006-05-21
I'm having a bit of trouble with updating a database. The code i have at the minute is......
Private Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnUpdate.Click
Dim dr() As DataRow = ds.Tables("Customers").Select("CustomerID = '" & cbCustomers.SelectedItem(0) & "'")
If UBound(dr) > -1 Then
dr(0)("CompanyName") = TextBox1.Text
.....When i click the button, the dataset seems to change but the database isn't actually updated. I have found though that is i change
dr(0)("CompanyName") = TextBox1.Text to
dr(0)("CompanyName") = "New companyname"
it updates properly. I have tried everything I can think of but I'm still really new to all this, can anyone point me in the right direction??