Hi,
I have an ultracombo control that gets filled by a dataset. If I do not choose anything and press the save button the value of the combo equals 'default' and the SQL stored procedure gives an error as 'default' is passed instead of null.
How can I send a null value if nothing is selected?
Thanks.
I don't understand. What do you mean by "default"? Is this a string? If so, where is it coming from? The Combo doesn't default to some arbitrary string as it's value so this must be coming from something in your code or your data.
I am using SQL Server.
One of the parameteres in my form is an ultraCombo and I pass the following parameter when updating the record.
comm.Parameters.Add("@Surgeon", SqlDbType.BigInt).Value = cmbSurgeons.Value;
However this gives an error saying that stored procedure 'xxxx' expects parameter "@Surgeon" which was not supplied.
In SQL Profiler these are the values that are passed
exec tblSurgicalProcedure_INSERT @Patient = 1715, @PerformedDate = 'Dec 21 2007 5:20:41:000PM', @Surgeon = default, @Remarks = NULL
As you can see the @Surgeon got a value of 'default' instead of null.