I'm trying to insert a selected value from a combo-box (Win forms)
I have two combo boxes that use different data type (Int and tinyint)
Data Type int is working
What I have tried:
For INT code is working
<pre>eventInfo.PersonDetailModuleID = Convert.ToInt32(cboPersonDetailModule.SelectedValue.ToString())
For TinyInt code is not working
eventInfo.ChildPersonDetailModuleID = Convert.ToByte(cboPersonDetailModuleChild.SelectedValue.ToString())
DAL
parms[2] = new SqlParameter("@PersonDetailModuleID", SqlDbType.Int, 4,ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, businessObject.PersonDetailModuleID);
parms[3] = new SqlParameter("@ChildPersonDetailModuleID", SqlDbType.TinyInt,1, ParameterDirection.Input, false, 0, 0, "", DataRowVersion.Proposed, businessObject.ChildPersonDetailModuleID);
Error OR Warning:
FormatException was unhandled
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Input string was not in a correct format