Link to home
Start Free TrialLog in
Avatar of dbaGrant
dbaGrantFlag for United States of America

asked on

Using EntityDataSoruce and nullable column. How do I set update the column in my db to null?

Can anyone reliably get the EntityDataSource to save a nullable column to the databse as a "null" when bound to any of the controls, such as "FormView"?

I have tried using several different UpdateParameters (SessionParameter, ControlParamater, Parameter,  etc). I have tried setting "ConvertEmptyStringToNull" to true and leaving the property off entirely. Nothing works. On my "Inserts" it works fine (but obviously to insert a record, it has to insert "something" if there is no value.)

(I have made sure the column is set to nullable = true in the Entity Designer.....)

I have tried binding that column to a label and setting the text value of the label to "".

In all these cases, I can successfully set the column to a value, just not to NULL.
Avatar of karthitron
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gautham Janardhan
Gautham Janardhan

you will need to explicily set it null in the entity object to have entity frame work to update it to the DB