DataAdapter.Update inserting null instead of string
519306Jun 20 2006 — edited Jun 21 2006Forgive me if someone covered this already. I've searched for a day now and can't find anything on this issue I'm having.
I'm using VS 2005 VB.NET, ODP.NET 10.2.0.1, and 10g.
In short, my problem is that I'm adding a new DataRow to a DataTable and then call DataAdapter.Update(DataTable) to have the DataAdapter insert the new row into the table. I'm using the OracleCommandBuilder to build the insert command. Now everything seems to work fine EXCEPT that any varchar2 fields in the table are getting populated with null instead of the passed parameterized string. Interestingly enough, if I modify an existing DataRow in a DataTable and call DataAdapter.Update(DataTable), the varchar2 fields accept the strings just fine, no nulls.
I'm not receiving any error codes or messages and if I look at the v_$sql, the command Oracle received looks correct (although I'm not sure how to verify on the Oracle side the parameter values that are being sent).
I know I can write a workaround that would retrieve the newly inserted row, update the varchar2 fields with the strings again, and recall .Update but that seems silly and inefficient.
Has anyone seen this issue or, better yet, figured out how to fix it? I can post code if my description doesn't make sense.
Thank you,
Josh