Author: DeepPowder | Posted on: 5/26/2010 11:50:22 AM | Views : 324

 I have created a  FormView that has several dropdownlists.  The drop down lists are based on Linq DataSources from tables in SQL Server.  The primary keys of the lookup tables used for the dropdown lists are strings and as primary keys cannot be null.  In each of the drop down lists, I have added a listitem with no value and text = "".  This displays blanks in the drop down lists.  This prevents user from inadvertently accepting the first list option displayed from the datasource (this may not be corrrect)
So I open my page in insert mode.  Do not enter a value in some of the dropdown lists and insert the record.  I get the following message
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Client_EmailType_Lookup". The conflict occurred in database "FSAP", table "dbo.EmailType_Lookup", column 'EmailTypeCode'
because null is not an acceptable value ...

Go to the complete details ...