December 8, 2006
Handled automatically
So I was all ready to send in my bug report and reduction to Microsoft when I found this article on MSDN. It described my situation perfectly, and gave me just enough hints to fix the bug. However, I think the article is a bit self-contradictory. At one point, it says,Once you create a new parent row (for example, a row in the "Customer" table) and let ADO.NET generate its new Identity value, you can create as many child rows (for example, "Orders") as necessary and safely use the parent's ADO.NET-generated Identity value as a foreign key (so the child row is tied back to the correct parent). Yes, ADO.NET knows how to handle these relationships correctly when it comes time to post these new rows to the server.This, along with all the other ADO.NET documentation, lulls you into a false sense of security. Then the interesting part comes:
The real problems come when you want to find out what Identity values have been generated by the server-side DBMS engine. Unfortunately, ADO.NET does nothing on its own to help.How can you say "ADO.NET knows how to handle these relationships correctly when it comes time to post these new rows to the server" and then say that? Or even worse, include 200 lines of VB.NET code to teach ADO.NET how to handle those relationships correctly for a trivial example? Do you have a flawed understanding of the English language?
Posted by Jeffrey at December 8, 2006 11:59 AM
What is a TrackBack? Learn more here. TrackBack URL for this entry:
http://www.geekable.com/cgi-bin/mt-tb.cgi/1304
Listed below are links to the 0 weblogs that reference 'Handled automatically' from Geekable.com.
http://www.geekable.com/cgi-bin/mt-tb.cgi/1304
Listed below are links to the 0 weblogs that reference 'Handled automatically' from Geekable.com.

