In a dynamic data web application, I get a validation error on a non-null nvarchar(50) column in ListDetails.aspx, even though I have entered a value which should be accepted. The validation error is: "This property cannot be set to a null value.".
I can not reproduce this on northwind/adventureworks.
Any ideas?
UPDATE: I have created a complete test case:
http://printf.no/DynamicDataBugTest.zip (The archive was scanned with the latest AVG definitions before uploading to my private secure dedicated FreeBSD server)
The test case contains:
One Dynamic Data Web App project
One MS SQL Server 2005 database backup which contains a single table with three columns
One screenshot showing how the error manifests itself
I am fairly convinced now that this is a reproducible DD bug.
It's a DD validation error message. Red, scary text :) I need to correct my initial post though -- the problematic columns are indeed nullable! Here's the basic schema:
Another relevant tidbit is that this only happens in rows when the current value is an empty string (example: StreetAddress). For any row where the string is non-empty, it works fine.
>>I can not reproduce this on northwind/adventureworks.
<div mce_keep="true">Create a new Dynamic Data project and import just one table so you can reproduce the error.</div>
<div mce_keep="true">Create a new Dynamic Data project and import just one table from NW or AdventureWorksLT that has the same data type. You might need to change a type so they match exactly. If you can repro with NW/LT, problem solved.</div>
<div mce_keep="true">Reduce complexity of your app</div>
<div mce_keep="true">Add complexity of NW app</div>
Repeat steps 3&4 until they converge, ie, you either find the bug or reproduce with NW. Report back your findings.
However, I have created a complete test case:
http://printf.no/DynamicDataBugTest.zip (The archive was scanned with the latest AVG definitions before uploading to my private secure dedicated FreeBSD server)
The test case contains:
One Dynamic Data Web App project
One MS SQL Server 2005 database backup which contains a single table with three columns
One screenshot showing how the error manifests itself
I am fairly convinced now that this is a reproducible DD bug.
Hi Andreas, I found what was wrong initially I got the same error on my system as yours but I noticed that even when I made a change to the Global.asax.cs file this was not relected in the running website so I deleted the contents of the bin and obj folders
(usually hidden just click the "Show All Files" button) recompiled and all was fine the error was gone. All I can think of it's some setting on your copy of VS not recompiling the website because once I had deleted the comipled files I can make changes and
rerun and the changes now are there straight away.
Hope this helps [:D]
Dynamic Data
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
Marked as answer by ricka6 on Mar 11, 2009 02:14 AM
andrerav
Member
12 Points
18 Posts
Validation error: This property can not be set to a null value [updated with test case!]
Mar 05, 2009 12:26 PM|LINK
In a dynamic data web application, I get a validation error on a non-null nvarchar(50) column in ListDetails.aspx, even though I have entered a value which should be accepted. The validation error is: "This property cannot be set to a null value.".
I can not reproduce this on northwind/adventureworks.
Any ideas?
UPDATE: I have created a complete test case: http://printf.no/DynamicDataBugTest.zip (The archive was scanned with the latest AVG definitions before uploading to my private secure dedicated FreeBSD server)
The test case contains:
I am fairly convinced now that this is a reproducible DD bug.
-Andreas
sjnaughton
All-Star
27387 Points
5483 Posts
MVP
Re: Validation error: This property can not be set to a null value
Mar 05, 2009 12:54 PM|LINK
Can you post the schema of the table in question? And is the error shown as a DD Validation error or a Yellow screnn?
Dynamic Data Validation Error
Always seeking an elegant solution.
andrerav
Member
12 Points
18 Posts
Re: Validation error: This property can not be set to a null value
Mar 05, 2009 01:01 PM|LINK
andrerav
Member
12 Points
18 Posts
Re: Validation error: This property can not be set to a null value
Mar 05, 2009 01:05 PM|LINK
sjnaughton
All-Star
27387 Points
5483 Posts
MVP
Re: Validation error: This property can not be set to a null value
Mar 05, 2009 01:36 PM|LINK
Is it the StreetAddress that is the column or is it any column that causes the error?
Dynamic Data Validation Error
Always seeking an elegant solution.
sjnaughton
All-Star
27387 Points
5483 Posts
MVP
Re: Validation error: This property can not be set to a null value
Mar 05, 2009 01:50 PM|LINK
Is this from right clicking the table and going:
If not could you do that and paste as I can't see a PK or any constraints. [:D]
Dynamic Data Validation Error
Always seeking an elegant solution.
andrerav
Member
12 Points
18 Posts
Re: Validation error: This property can not be set to a null value
Mar 05, 2009 02:06 PM|LINK
ricka6
All-Star
15088 Points
2277 Posts
Microsoft
Moderator
Re: Validation error: This property can not be set to a null value
Mar 06, 2009 04:47 PM|LINK
>>I can not reproduce this on northwind/adventureworks.
Repeat steps 3&4 until they converge, ie, you either find the bug or reproduce with NW. Report back your findings.
andrerav
Member
12 Points
18 Posts
Re: Validation error: This property can not be set to a null value
Mar 10, 2009 09:23 AM|LINK
However, I have created a complete test case: http://printf.no/DynamicDataBugTest.zip (The archive was scanned with the latest AVG definitions before uploading to my private secure dedicated FreeBSD server)
The test case contains:
I am fairly convinced now that this is a reproducible DD bug.
-Andreas
sjnaughton
All-Star
27387 Points
5483 Posts
MVP
Re: Validation error: This property can not be set to a null value
Mar 10, 2009 10:10 AM|LINK
Hi Andreas, I found what was wrong initially I got the same error on my system as yours but I noticed that even when I made a change to the Global.asax.cs file this was not relected in the running website so I deleted the contents of the bin and obj folders (usually hidden just click the "Show All Files" button) recompiled and all was fine the error was gone. All I can think of it's some setting on your copy of VS not recompiling the website because once I had deleted the comipled files I can make changes and rerun and the changes now are there straight away.
Hope this helps [:D]
Dynamic Data
Always seeking an elegant solution.