|
-
October 4th, 2010, 02:31 PM
#1
Format Exception
I get "Input string was not in a correct format." on the following when attempting to pass a null value:
ProductType = new clsProductType();
ProductType.SortOrder = Int32.Parse(txtSortOrder.Text); <----- This Line.
//ProductType.SortOrder = Convert.ToInt32(txtSortOrder.Text); <----- Also tried this
Sort Order is declared as such:
public int? SortOrder { get; set; }
In the constructor for the class i have SortOrder = null, and elsewhere in the code have it take a number from a textbox
SortOrder is used to pass a variable so that it can be written to an SQL Table. The value needs to accept an integer but can also be null-able.
Any Ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|