Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Input string was not in a correct format
Message
From
20/04/2006 08:01:13
Ilyas Mirza
Kensington Computersd
London, United Kingdom
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Input string was not in a correct format
Miscellaneous
Thread ID:
01114905
Message ID:
01114905
Views:
47
I am having a problem with mmDropDownList control. The control is bound to a data source and gets its items from another table. if there are no items in the list to choose from then when saving the form, I get the following error: The dataField to which DropDownList is bound to may contain null value.

System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ToInt32(Object value) at System.Data.Common.Int32Storage.Set(Int32 record, Object value) at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store <> in Ticket_Contact_id Column. Expected type is Int32.

If DropDownList is populated and I choose one of the valuse then you don't get the error.

This is also true with other controls, for-example if a textbox is bound to a DateTime Field then upon saving if the data field was null and a date is not typed in the textbox, you get the same error.

Does anyone know what's the best way to get round this issue.

Thanks,

Ilyas
Next
Reply
Map
View

Click here to load this message in the networking platform