UsenetUser
2009-07-25 08:23:47 UTC
Can someone tell me what the problem is with this? The right values
are shown from the debug lines but the values are not saved. There is
no error. The source table has a primary key. The examples in the help
system do not indicate that beginedit, endedit or acceptchanges, or
other updating commands are necessary, but I have tried using the
first 3 as well.
Thanks.
Sub stest()
Dim conn As New SqlConnection(strConn) 'PB
Dim DSWriteBooking As DataSet = New DataSet
Dim strSQLWrite As String = "SELECT * FROM tblBookingW1"
Dim adpWrite As SqlDataAdapter = New
SqlDataAdapter(strSQLWrite, conn)
Dim EditRow() As DataRow
Try
adpWrite.Fill(DSWriteBooking, "tblBookingW1")
'Returns 10 rows
EditRow = DSWriteBooking.Tables(0).Select("PIDS1 = 0")
Debug.Print(EditRow(0)(1).ToString) '0
EditRow(0)(1) = 99
Debug.Print(EditRow(0)(1).ToString) '99
conn.Close()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
conn = Nothing
adpWrite = Nothing
End Try
End Sub
are shown from the debug lines but the values are not saved. There is
no error. The source table has a primary key. The examples in the help
system do not indicate that beginedit, endedit or acceptchanges, or
other updating commands are necessary, but I have tried using the
first 3 as well.
Thanks.
Sub stest()
Dim conn As New SqlConnection(strConn) 'PB
Dim DSWriteBooking As DataSet = New DataSet
Dim strSQLWrite As String = "SELECT * FROM tblBookingW1"
Dim adpWrite As SqlDataAdapter = New
SqlDataAdapter(strSQLWrite, conn)
Dim EditRow() As DataRow
Try
adpWrite.Fill(DSWriteBooking, "tblBookingW1")
'Returns 10 rows
EditRow = DSWriteBooking.Tables(0).Select("PIDS1 = 0")
Debug.Print(EditRow(0)(1).ToString) '0
EditRow(0)(1) = 99
Debug.Print(EditRow(0)(1).ToString) '99
conn.Close()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
conn = Nothing
adpWrite = Nothing
End Try
End Sub