all groups > sql server new users > june 2007 >
You're in the

sql server new users

group:

SQL 2005 Express, Insert & NoNullAllowedException


SQL 2005 Express, Insert & NoNullAllowedException Alexander Gorbylev
6/25/2007 6:35:01 PM
sql server new users:
Dear Sirs,
I have a traditional SQL 2005 Express table with fields,
e.g.

SubsurfaceID - (PKey) int, Not NULL (autoincremental from 1 by step 1),
Name - varchar,
Field1 stc.

After INSERT by TableAdapter VS 2005 I got exception
"NoNullAllowedException":
DataRow newSubsurface = subsurfaceDS.tSubsurface.NewtSubsurfaceRow();
newSubsurface["Name"] = "Item 1";
subsurfaceDS.tSubsurface.Rows.Add(newSubsurface);

The situation almost is the same where I try insert row manually by means
SQL Server Management Studio: I go to new row and write value to "field1",
go to "field2" and got... Exception: No retrived data (ID is Null)!
Row viewed only by "SELECT * FROM tSubsurface;" generated Management Studio
(region SQL) and the row is renew by calculated ID.

Why? Is this feature of SQL 2005 Express?

-----------
Looking forward to hearing from you soonest,
Alexander GORBYLEV
Re: SQL 2005 Express, Insert & NoNullAllowedException Alexander Gorbylev
6/26/2007 12:00:00 AM
Somewhat near to this is on:
The reason is... default value! Alexander Gorbylev
6/29/2007 12:00:00 AM
Only when I deleted default value, the rows are inserting

Alexander GORBYLEV
Re: The reason is... default value! Alexander Gorbylev
7/5/2007 12:00:00 AM

[quoted text, click to view]

And this field was as @-parameter with value NILL :-/

AddThis Social Bookmark Button