Hi List,
I created a typed dataset by dragging the table from Server Explorer onto my dataset designer. The TableAdapter.Fill and FillByXXX methods (that I created) work perfectly, but the Update method always returns 0. I placed the following code just before the Update method call just to make sure the adapter realizes that some rows have been added:
When I execute the above code I get the prompt "RowState = Added", followed by the prompt "Rows affected = 0". The adapter doesn't update anything!
I even went as far as deliberately modifying the INSERT, UPDATE and DELETE commands so as to produce a syntax error. E.g. InsertCommand.CommandText = "I_N_SERT INTO...". The Update() method didn't even throw an exception.
I'm using VS2005 and I'm connecting to an SQL Server 2005 database (Pro Edition). Any ideas? I'm stumped
I created a typed dataset by dragging the table from Server Explorer onto my dataset designer. The TableAdapter.Fill and FillByXXX methods (that I created) work perfectly, but the Update method always returns 0. I placed the following code just before the Update method call just to make sure the adapter realizes that some rows have been added:
VB.NET:
Dim row As dsTest.TestTableRow
For Each row In dsTest.TestTable
MsgBox("RowState = " & row.RowState.ToString)
Next
Msgbox("Rows affected = " & adpTestAdapter.Update(dsTest.TestTable))
When I execute the above code I get the prompt "RowState = Added", followed by the prompt "Rows affected = 0". The adapter doesn't update anything!
I even went as far as deliberately modifying the INSERT, UPDATE and DELETE commands so as to produce a syntax error. E.g. InsertCommand.CommandText = "I_N_SERT INTO...". The Update() method didn't even throw an exception.
I'm using VS2005 and I'm connecting to an SQL Server 2005 database (Pro Edition). Any ideas? I'm stumped