Adding A New Row to my DataSet :(
I'm trying to use the following code and it's giving me a big, big headache..
VB Code:
Dim NewRow As DataRow = DS.Tables("Users").NewRow
NewRow!UserName = txtUserName.Text
NewRow!Password = txtPassword.Text
NewRow!Type = "User"
DS.Tables("Users").Rows.Add(NewRow)
Dim CB As New OleDbCommandBuilder(DA)
DA.UpdateCommand = CB.GetUpdateCommand
DA.Update(DS, "Users")
This works just fine if i don't add the record
is there anything I need to do between adding the record and updating the thing? Thanks.
Squirrelly1
Re: Adding A New Row to my DataSet :(
VB Code:
Dim NewRow As DataRow = DS.Tables("Users").NewRow
NewRow!UserName = txtUserName.Text
NewRow!Password = txtPassword.Text
NewRow!Type = "User"
DS.Tables("Users").Rows.Add(NewRow)
Dim CB As New OleDbCommandBuilder(DA)
DA.UpdateCommand = CB.GetInsertCommand()
DA.Update(DS, "Users")
Untested, of course. :afrog: