I want to save data in to my ACCESS database from textboxes. My code is here.
Private Sub BtnSubmit_Click(sender As Object, e As EventArgs) Handles BtnSubmit.Click
Dim cb As New OleDb.OleDbCommandBuilder(DA)
Dim dsNewRow As DataRow
DA = New OleDb.OleDbDataAdapter(SQL, CN)
DA.Fill(DS, "Deposit")
dsNewRow = DS.Tables("Deposit").NewRow()
dsNewRow.Item("Bank") = TxtBank.Text
dsNewRow.Item("Acno") = TxtAcno.Text
dsNewRow.Item("Name") = TxtName.Text
DS.Tables("Deposit").Rows.Add(dsNewRow)
DA.Update(DS, "Deposit")
MsgBox("New Record added to the Database")
clearall()
End Sub
On running the programme It is interrupted and getting the following message "Update requires a valid Insert Command when passed DataRow Collection with new rows". Please correct my code Or guide me how can I save the datas from my text boxes.. Thanks in advance...