Open GoogleCodeExporter opened 9 years ago
Update: I can make it work if I edit the generated code to use the property
ManufacturerId instead of the field _manufacturerID.
Original comment by matthieu...@gmail.com
on 29 Jan 2010 at 3:02
It does not work, however, if I don't change the generated source code and use
the
property externally. What the?? :P
Original comment by matthieu...@gmail.com
on 31 Jan 2010 at 6:29
I created a test case against the Northwind database. See Bug #1 in the source
code.
Original comment by matthieu...@gmail.com
on 2 Feb 2010 at 1:11
Attachments:
I also found this message (May 2009) where Jonathan Pryor talks about this
issue. It
was supposed to be fixed though :P
http://www.mail-archive.com/dblinq@googlegroups.com/msg00977.html
Original comment by matthieu...@gmail.com
on 2 Feb 2010 at 5:27
This is something different from r1073.
Case in point: when I try to run "Bug 1" under SQL Server, it aborts with:
System.Data.SqlClient.SqlException : Cannot insert explicit value for identity
column
in table 'Orders' when IDENTITY_INSERT is set to OFF.
In English, SQL Server doesn't like inserting a row when you're ALSO inserting
the
primary key. SQL Server wants to generate the PK, which is counter to your
example
code (in which you use 'new Random().Next()' to create one).
If I use this for my Northwind test code:
var db = CreateDB();
Order o = new Order();
o.ShipAddress = "This is really a test. delete me!";
Customer c = new Customer();
c.CustomerID = "TEST!";
c.CompanyName = "TestCompany";
db.Orders.InsertOnSubmit(o);
db.Customers.InsertOnSubmit(c);
db.SubmitChanges();
o.Customer = c;
db.SubmitChanges();
Then the first db.SubmitChanges() call works in SQL Server (and is in the DB).
The
second db.SubmitChanges() call fails because, apparently, a SQL command hasn't
been
generated (!).
So apparently (1) SQL Server is stricter than PostgreSQL (I'm assuming here
that
PostgreSQL isn't generating an error when attempting to execute an empty
command),
and (2) nothing is executed with the second db.SubmitChanges() call.
Original comment by jonmpr...@gmail.com
on 6 Mar 2010 at 5:01
Original issue reported on code.google.com by
matthieu...@gmail.com
on 29 Jan 2010 at 2:59