I'm trying to add a row to my dataset using the following:
Dim foundRow As DataRow = DsMembers.Members.NewRow
foundRow("FirstName") = scannedMember.FirstName
foundRow("MiddleName") = scannedMember.MiddleName
foundRow("LastName") = scannedMember.LastName
foundRow("Address") = scannedMember.Address
foundRow("City") = scannedMember.City
foundRow("State") = scannedMember.State
foundRow("Zip") = scannedMember.Zip
foundRow("DOB") = scannedMember.DOB
foundRow("TDL") = scannedMember.TDL
foundRow("MemberID") = scannedMember.MemberID
foundRow("DateJoined") = scannedMember.DateJoined
foundRow("DateExpired") = scannedMember.DateExpired
If scannedMember.Barred <> Nothing Then
foundRow("Barred") = scannedMember.Barred
If scannedMember.Barred = "Y" Then
foundRow("BarredReason") = scannedMember.BarredReason
End If
Else
foundRow("Barred") = "N"
foundRow("BarredReason") = " "
End If
DsMembers.Members.Rows.Add(foundRow) '.AddMembersRow(foundRow)
DsMembers.Members.AcceptChanges()
For some reason, even though the rowState says "Added", the row is never added to the dataset. If I run
DsMembers.Members.FindByTDL(scannedMember.TDL)
after calling AcceptChanges it doesn't find anything. Any ideas? Thanks!