B
!!bogus
Hi,
This is partial code. I am trying to update the table, but it is not working
and I am not sure why. Can you please help? I don't get any errors, but the
table is not updated. I am sure I am missing something
Thank you
Dim cnNewMember As SqlConnection = New
SqlConnection(Constants.ConnectionString)
Dim dsNewMember As New DataSet("NewMember")
Try
Dim daNewMember As New SqlDataAdapter( _
"SELECT * FROM tree_members", cnNewMember)
cnNewMember.Open()
daNewMember.Fill(dsNewMember)
Dim strAName As String = Response.Cookies("aname").Value
Dim strANickName As String = Response.Cookies("anickname").Value
Dim strFatherID As Integer =
CInt(Response.Cookies("fatherid").Value)
Dim strMotherID As Integer =
CInt(Response.Cookies("motherid").Value)
Dim drNewMember As DataRow
drNewMember = dsNewMember.Tables(0).NewRow
drNewMember.Item("aname") = strAName
drNewMember.Item("anickname") = strANickName
drNewMember.Item("fatherid") = strFatherID
drNewMember.Item("motherid") = strMotherID
dsNewMember.Tables(0).Rows.Add(drNewMember)
If dsNewMember.HasChanges Then
dsNewMember.AcceptChanges()
dsNewMember.Tables(0).AcceptChanges()
'Response.Write(dsNewMember.Tables(0).Rows.Item(1))
daNewMember.Update(dsNewMember.Tables(0))
End If
Catch
.....
.....
This is partial code. I am trying to update the table, but it is not working
and I am not sure why. Can you please help? I don't get any errors, but the
table is not updated. I am sure I am missing something
Thank you
Dim cnNewMember As SqlConnection = New
SqlConnection(Constants.ConnectionString)
Dim dsNewMember As New DataSet("NewMember")
Try
Dim daNewMember As New SqlDataAdapter( _
"SELECT * FROM tree_members", cnNewMember)
cnNewMember.Open()
daNewMember.Fill(dsNewMember)
Dim strAName As String = Response.Cookies("aname").Value
Dim strANickName As String = Response.Cookies("anickname").Value
Dim strFatherID As Integer =
CInt(Response.Cookies("fatherid").Value)
Dim strMotherID As Integer =
CInt(Response.Cookies("motherid").Value)
Dim drNewMember As DataRow
drNewMember = dsNewMember.Tables(0).NewRow
drNewMember.Item("aname") = strAName
drNewMember.Item("anickname") = strANickName
drNewMember.Item("fatherid") = strFatherID
drNewMember.Item("motherid") = strMotherID
dsNewMember.Tables(0).Rows.Add(drNewMember)
If dsNewMember.HasChanges Then
dsNewMember.AcceptChanges()
dsNewMember.Tables(0).AcceptChanges()
'Response.Write(dsNewMember.Tables(0).Rows.Item(1))
daNewMember.Update(dsNewMember.Tables(0))
End If
Catch
.....
.....