S
Sébastien
Here is my code :
oldOleDbDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM " &
strTable, strConnection)
dttDataTable = New DataTable(strTable)
oldOleDbDataAdapter.FillSchema(dttDataTable, SchemaType.Mapped)
oldOleDbDataAdapter.Fill(dttDataTable)
dtsDataSet.Tables.Add(dttDataTable)
Here is my problem :
If I have 0 rows in one of my table before I start my software, then add a
new Row, then I modify that same row, I get a concurrency exception. But if
I had 1 or more rows before I start my application, there is no problem. I
got a way to bypass it. After the first add in my Table, I do this :
oldOleDbDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM " &
strTable, strConnection)
dttDataTable = New DataTable(strTable)
oldOleDbDataAdapter.FillSchema(dttDataTable, SchemaType.Mapped)
oldOleDbDataAdapter.Fill(dttDataTable)
dtsDataSet.Tables.Remove(strTable)
dtsDataSet.Tables.Add(dttDataTable)
I don't need to do it after the second, third, etc... row is inserted. That
is very ugly code. I would like to know why it work only when I do
oldOleDbDataAdapter.Fill and there is data in the DataBase. What does
oldOleDbDataAdapter.Fill do so different when there is no data in the
DataBase ?
Thank you for your help.
oldOleDbDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM " &
strTable, strConnection)
dttDataTable = New DataTable(strTable)
oldOleDbDataAdapter.FillSchema(dttDataTable, SchemaType.Mapped)
oldOleDbDataAdapter.Fill(dttDataTable)
dtsDataSet.Tables.Add(dttDataTable)
Here is my problem :
If I have 0 rows in one of my table before I start my software, then add a
new Row, then I modify that same row, I get a concurrency exception. But if
I had 1 or more rows before I start my application, there is no problem. I
got a way to bypass it. After the first add in my Table, I do this :
oldOleDbDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM " &
strTable, strConnection)
dttDataTable = New DataTable(strTable)
oldOleDbDataAdapter.FillSchema(dttDataTable, SchemaType.Mapped)
oldOleDbDataAdapter.Fill(dttDataTable)
dtsDataSet.Tables.Remove(strTable)
dtsDataSet.Tables.Add(dttDataTable)
I don't need to do it after the second, third, etc... row is inserted. That
is very ugly code. I would like to know why it work only when I do
oldOleDbDataAdapter.Fill and there is data in the DataBase. What does
oldOleDbDataAdapter.Fill do so different when there is no data in the
DataBase ?
Thank you for your help.