Hi all,
I am starting to learn how to program VB.Net and I found got an problem when
try to insert a new row into the table.
I had create an form to whole all the DataSet, OleDbDataAdaper and connection. Each adapter will only hold one table and one type of transaction e.g. dsADataGrid (table A use for data grid only), dsA (for select, indert, update ...), dsAMaxCC (for select the maximun value in CC column from table A)
I have no idea what's wrong as Exception always Catch the NEWROW statement after execute.
connection established during the main form open
The table AGENCY-CC only got 2 fields "CC" integer and "COMPANY_NAME" string(60)
db = OleDbDataAdaper
ds = dataset
With frmDataModule
Try
.dsAGENCYCC.Clear()
drAddrow = .dsAGENCYCC.Tables("AGENCY-CC").NewRow()
drAddrow("CC") = intCC
drAddrow("COMPANY_NAME") = txtCompanyName.Text
.dsAGENCYCC.Tables("AGENCY-CC").Rows.Add(drAddrow)
.dbAGENCYCC.Update(.dsAGENCYCC, "AGENCY-CC")
Catch ex As Exception
MessageBox.Show("Add Database Record Error. Key = " & txtCompanyName.Text, "Data Add Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End With
Please help!!!