Hello All,
I'm having this problem which deals with 2 tables in a database. Both tables have a primary key set as an autonumber but also both tables are dependent on each other by having their primary key as a value in their tables. The problem is when I add new rows to get the autonumber in order to put it to the other table the autonumber is a null but when I check the database the new row is there with the new autonumber. Here is the code that I have been working on. Can someone spot a problem that I am not aware of, thanks.
I'm having this problem which deals with 2 tables in a database. Both tables have a primary key set as an autonumber but also both tables are dependent on each other by having their primary key as a value in their tables. The problem is when I add new rows to get the autonumber in order to put it to the other table the autonumber is a null but when I check the database the new row is there with the new autonumber. Here is the code that I have been working on. Can someone spot a problem that I am not aware of, thanks.
VB.NET:
[SIZE=2][COLOR=#008000]'Insert new header data
[/COLOR][/SIZE][SIZE=2]dbInventaire.Open()
sqlstring = [/SIZE][SIZE=2][COLOR=#800000]"select * from HeaderOrder"
[/COLOR][/SIZE][SIZE=2]updater = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(sqlstring, dbInventaire)
CmdBuilder = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbCommandBuilder(updater)
CmdBuilder.QuotePrefix = [/SIZE][SIZE=2][COLOR=#800000]"["
[/COLOR][/SIZE][SIZE=2]CmdBuilder.QuoteSuffix = [/SIZE][SIZE=2][COLOR=#800000]"]"
[/COLOR][/SIZE][SIZE=2]updater.InsertCommand = CmdBuilder.GetInsertCommand
[/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2]updater.Fill(ds, [/SIZE][SIZE=2][COLOR=#800000]"HeaderOrder"[/COLOR][/SIZE][SIZE=2])
table = ds.Tables.Item(0)
row = table.NewRow
[/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList1.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField1"[/COLOR][/SIZE][SIZE=2]) = DropDownList1.SelectedValue
val(1) = DropDownList1.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList2.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField2"[/COLOR][/SIZE][SIZE=2]) = DropDownList2.SelectedValue
val(2) = DropDownList2.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList3.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField3"[/COLOR][/SIZE][SIZE=2]) = DropDownList3.SelectedValue
val(3) = DropDownList3.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList4.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField4"[/COLOR][/SIZE][SIZE=2]) = DropDownList4.SelectedValue
val(4) = DropDownList4.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList5.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField5"[/COLOR][/SIZE][SIZE=2]) = DropDownList5.SelectedValue
val(5) = DropDownList5.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList6.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField6"[/COLOR][/SIZE][SIZE=2]) = DropDownList6.SelectedValue
val(6) = DropDownList6.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList7.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField7"[/COLOR][/SIZE][SIZE=2]) = DropDownList7.SelectedValue
val(7) = DropDownList7.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList8.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField8"[/COLOR][/SIZE][SIZE=2]) = DropDownList8.SelectedValue
val(8) = DropDownList8.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList9.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField9"[/COLOR][/SIZE][SIZE=2]) = DropDownList9.SelectedValue
val(9) = DropDownList9.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList10.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField10"[/COLOR][/SIZE][SIZE=2]) = DropDownList10.SelectedValue
val(10) = DropDownList10.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList11.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField11"[/COLOR][/SIZE][SIZE=2]) = DropDownList11.SelectedValue
val(11) = DropDownList11.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList12.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField12"[/COLOR][/SIZE][SIZE=2]) = DropDownList12.SelectedValue
val(12) = DropDownList12.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] DropDownList13.SelectedValue <> [/SIZE][SIZE=2][COLOR=#800000]"Select"[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row([/SIZE][SIZE=2][COLOR=#800000]"HField13"[/COLOR][/SIZE][SIZE=2]) = DropDownList13.SelectedValue
val(13) = DropDownList13.SelectedIndex
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2]table.Rows.Add(row)
newrechead = table.Rows.Count - 1
updater.Update(ds, [/SIZE][SIZE=2][COLOR=#800000]"HeaderOrder"[/COLOR][/SIZE][SIZE=2])
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception
MsgBox(ex.Message)
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2]
[/SIZE][SIZE=2][COLOR=#008000]'Add Event fields with text chosen from textbox to Event table
[/COLOR][/SIZE][SIZE=2]dbInventaire.Open()
sqlstring = [/SIZE][SIZE=2][COLOR=#800000]"select * from Event"
[/COLOR][/SIZE][SIZE=2]updater2 = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(sqlstring, dbInventaire)
CmdBuilder = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbCommandBuilder(updater2)
CmdBuilder.QuotePrefix = [/SIZE][SIZE=2][COLOR=#800000]"["
[/COLOR][/SIZE][SIZE=2]CmdBuilder.QuoteSuffix = [/SIZE][SIZE=2][COLOR=#800000]"]"
[/COLOR][/SIZE][SIZE=2]updater2.InsertCommand = CmdBuilder.GetInsertCommand
[/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2]updater2.Fill(ds2, [/SIZE][SIZE=2][COLOR=#800000]"Event"[/COLOR][/SIZE][SIZE=2])
table2 = ds2.Tables.Item(0)
row2 = table2.NewRow
[/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] TextBox3.Text <> [/SIZE][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row2([/SIZE][SIZE=2][COLOR=#800000]"eventname"[/COLOR][/SIZE][SIZE=2]) = TextBox3.Text
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] TextBox4.Text <> [/SIZE][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row2([/SIZE][SIZE=2][COLOR=#800000]"eventdate"[/COLOR][/SIZE][SIZE=2]) = TextBox4.Text
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] TextBox5.Text <> [/SIZE][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row2([/SIZE][SIZE=2][COLOR=#800000]"eventcategory"[/COLOR][/SIZE][SIZE=2]) = TextBox5.Text
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] TextBox6.Text <> [/SIZE][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then
[/COLOR][/SIZE][SIZE=2]row2([/SIZE][SIZE=2][COLOR=#800000]"eventres"[/COLOR][/SIZE][SIZE=2]) = TextBox6.Text
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'eventidx = CInt(row2("EventID"))
[/COLOR][/SIZE][SIZE=2]table2.Rows.Add(row2)
newrecevent = table2.Rows.Count - 1
updater2.Update(ds2, [/SIZE][SIZE=2][COLOR=#800000]"Event"[/COLOR][/SIZE][SIZE=2])
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception
MsgBox(ex.Message)
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'------------------------------------------------------------------------
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'Get header index to add to existing table with data
[/COLOR][/SIZE][SIZE=2]dbInventaire.Open()
sqlstring = [/SIZE][SIZE=2][COLOR=#800000]"select * from HeaderOrder"
[/COLOR][/SIZE][SIZE=2]updater = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(sqlstring, dbInventaire)
[/SIZE][SIZE=2][COLOR=#008000]'CmdBuilder = New OleDb.OleDbCommandBuilder(updater)
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'CmdBuilder.QuotePrefix = "["
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'CmdBuilder.QuoteSuffix = "]"
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'updater.UpdateCommand = CmdBuilder.GetUpdateCommand
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2]updater.Fill(ds)
table = ds.Tables.Item(0)
row = table.Rows.Item(newrechead)
headeridx = [/SIZE][SIZE=2][COLOR=#0000ff]CInt[/COLOR][/SIZE][SIZE=2](row([/SIZE][SIZE=2][COLOR=#800000]"HeaderID"[/COLOR][/SIZE][SIZE=2])) 'I get the problem here
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception
MsgBox(ex.Message)
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'Get event index to add to existing table with data
[/COLOR][/SIZE][SIZE=2]dbInventaire.Open()
sqlstring = [/SIZE][SIZE=2][COLOR=#800000]"select * from Event"
[/COLOR][/SIZE][SIZE=2]updater2 = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(sqlstring, dbInventaire)
[/SIZE][SIZE=2][COLOR=#008000]'CmdBuilder = New OleDb.OleDbCommandBuilder(updater2)
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'CmdBuilder.QuotePrefix = "["
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'CmdBuilder.QuoteSuffix = "]"
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'updater2.UpdateCommand = CmdBuilder.GetUpdateCommand
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2]updater2.Fill(ds2)
table2 = ds2.Tables.Item(0)
row2 = table2.Rows.Item(newrecevent)
eventidx = [/SIZE][SIZE=2][COLOR=#0000ff]CInt[/COLOR][/SIZE][SIZE=2](row2([/SIZE][SIZE=2][COLOR=#800000]"EventID"[/COLOR][/SIZE][SIZE=2]))
updater2.Update(ds2, [/SIZE][SIZE=2][COLOR=#800000]"Event"[/COLOR][/SIZE][SIZE=2])
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception
MsgBox(ex.Message)
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'Fill required eventid to header table
[/COLOR][/SIZE][SIZE=2]dbInventaire.Open()
sqlstring = [/SIZE][SIZE=2][COLOR=#800000]"select * from HeaderOrder"
[/COLOR][/SIZE][SIZE=2]updater = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(sqlstring, dbInventaire)
CmdBuilder = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbCommandBuilder(updater)
CmdBuilder.QuotePrefix = [/SIZE][SIZE=2][COLOR=#800000]"["
[/COLOR][/SIZE][SIZE=2]CmdBuilder.QuoteSuffix = [/SIZE][SIZE=2][COLOR=#800000]"]"
[/COLOR][/SIZE][SIZE=2]updater.UpdateCommand = CmdBuilder.GetUpdateCommand
[/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2]updater.Fill(ds, [/SIZE][SIZE=2][COLOR=#800000]"HeaderOrder"[/COLOR][/SIZE][SIZE=2])
table = ds.Tables.Item(0)
row = table.Rows.Item(newrechead)
row([/SIZE][SIZE=2][COLOR=#800000]"EventID"[/COLOR][/SIZE][SIZE=2]) = [/SIZE][SIZE=2][COLOR=#0000ff]CInt[/COLOR][/SIZE][SIZE=2](eventidx)
updater.Update(ds, [/SIZE][SIZE=2][COLOR=#800000]"HeaderOrder"[/COLOR][/SIZE][SIZE=2])
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception
MsgBox(ex.Message)
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'Fill required headerid to event table
[/COLOR][/SIZE][SIZE=2]dbInventaire.Open()
sqlstring = [/SIZE][SIZE=2][COLOR=#800000]"select * from Event"
[/COLOR][/SIZE][SIZE=2]updater2 = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataAdapter(sqlstring, dbInventaire)
CmdBuilder = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDb.OleDbCommandBuilder(updater2)
CmdBuilder.QuotePrefix = [/SIZE][SIZE=2][COLOR=#800000]"["
[/COLOR][/SIZE][SIZE=2]CmdBuilder.QuoteSuffix = [/SIZE][SIZE=2][COLOR=#800000]"]"
[/COLOR][/SIZE][SIZE=2]updater2.UpdateCommand = CmdBuilder.GetUpdateCommand
[/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2]updater2.Fill(ds2, [/SIZE][SIZE=2][COLOR=#800000]"Event"[/COLOR][/SIZE][SIZE=2])
table2 = ds2.Tables.Item(0)
row2 = table2.Rows.Item(newrecevent)
row2([/SIZE][SIZE=2][COLOR=#800000]"HeaderID"[/COLOR][/SIZE][SIZE=2]) = [/SIZE][SIZE=2][COLOR=#0000ff]CInt[/COLOR][/SIZE][SIZE=2](headeridx)
updater2.Update(ds2, [/SIZE][SIZE=2][COLOR=#800000]"Event"[/COLOR][/SIZE][SIZE=2])
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception
MsgBox(ex.Message)
dbInventaire.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try
[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'--------------------------------------------------------------------------
[/COLOR][/SIZE]
Last edited by a moderator: