Linq-to-SQL: Auto-generated column insert fails if the column name in the database and member name in the object model differs - by KristoferA - Huagati Systems

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 381883 Comments
Status Closed Workarounds
Type Bug Repros 7
Opened 11/13/2008 10:51:46 PM
Access Restriction Public


The "output inserted.[fieldname] into ..." clause generated by Linq to SQL when inserting in a table with an autogenerated column (member properties Auto Generated Value = true and Auto-Sync=OnInsert) incorrectly uses the object model name in the generated SQL.

The column name used in the "output" clause of the insert statement is from the Column/@Member attribute rather than from Column/@Name, resulting in a SQL error.
Sign in to post a comment.
Posted by subkamran on 8/3/2009 at 4:31 AM
I mentioned this in my validation comment, but it seems this only affects GUID columns. Other data types seem to work just fine.
Posted by KristoferA - Huagati Systems on 3/26/2009 at 5:19 PM
Hi Sarah,

Great to hear, thanks!

Best regards,
Posted by Microsoft on 3/26/2009 at 2:02 PM
FYI, I am also fixing the resolution so it should show up as "Fixed" instead of "Won't Fix". I'm not sure how soon it will propagate that change, but regardless, this *has* been fixed.

Posted by Microsoft on 3/26/2009 at 1:59 PM

The fix for this bug will be included in .NET Framework 4.0.

Sarah Parra
LINQ to SQL Team
Posted by Microsoft on 12/3/2008 at 11:10 AM
Thank you for your feedback. We’ll look into this issue for a later release.

If you have any other feedback or concerns, please let us know.

Thank you
Data Programmability Tools Team
Posted by KristoferA - Huagati Systems on 11/23/2008 at 7:52 PM
Users of Huagati DBML Tools that are affected by this bug can find more information here:
Posted by KristoferA - Huagati Systems on 11/17/2008 at 1:47 AM

a clarification: the references to Column/@Member and Column/@Name above refers to the storage location of the names in the DBML. In other words, the generated SQL uses the property's member name instead of the name from the "[Column(Name=..." attribute.

E.g. "TestTableID" instead of "test_table_id" from this example:

public Guid TestTableID
Posted by Microsoft on 11/17/2008 at 1:08 AM
Thanks for your feedback. We are escalating this bug to the product unit who works on that specific feature area. The team will review this issue and make a decision on whether they will fix it or not for the next release.

Thank you,
Visual Studio Product Team