Author: Beecraq | Posted on: 4/11/2009 1:52:22 AM | Views : 401

Am writing a CMS application and am stuck on one of my webforms. Am trying to get a BranchID value from an input string(branchList) to insert into  Employees table. Employees table is connected to the Branches table with BranchID as foreign key. Error is in this code:
comm.Parameters.Add("@BranchID", System.Data.SqlDbType.Int);
comm.Parameters["@BranchID"].Value = branchList.SelectedItem.Value; 
 Exception Details: System.FormatException: Input string was not in a correct format.

Source Error:





Line 51: conn.Open();
Line 52: // Execute the command
Line 53: comm.ExecuteNonQuery();
Line 54: // Reload page if the query ...

Go to the complete details ...