Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AllowNull but still getting NoNullAllowedException

Status
Not open for further replies.

abcfantasy

Programmer
Jun 3, 2006
110
DK
I just don't understand why. I've got a database table, with a column named 'Postcode' of type varchar(10) and allownull thicked.

Now when I add a record and leave the postcode empty, I get a NoNullAllowedException saying "Column 'Postcode' does not allow nulls".

I've spent hours now trying to solve it and just can't find why.

ABC -
 
1. which DBMS?
2. is allow null ticked on the database, or in the table definition in VS?



mr s. <;)

 
I'm able to carry out the same operation at my side as per your requirement. I didn't get any error for this. Check your generated Insert statement, checkout the order of values passed to the query, single quotes for passing the varchar. Thats it I think so...

Sharing the best from my side...

--Prashant--
 
Thanks for your help, it has been solved. Seems although allow dbnull was ticked from the table definition, the properties of the column in the dataset diagram.

Thanks again


ABC -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top