c# - Look up table allowing null -


i have incident table has incidenttypeid(int) foreign key allowing null.

the incidenttype table has 2 columns id auto increment primary key not null , incidenttype not null nvarchar.

the incidenttype table populating ddl have listitem selected selected , value of "". checking if value "" , if setting selectedvalue of ddl null.

when select ddl fine , works ok.

when try , insert nothing selected , set null sqlexception on foreign key constraint on incidenttype id column not allowing null primary key .

how can round allowing null?

primary key cannot null. not possible entry must have id number. otherwise there noting create.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -