Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Input string was not in a correct format

Hi,
When running the below codes,
                try
                {
                    cmd = new SqlCommand("insert into dbo.tab3 (user_id,rec_id,rec_desc,change_date) values (@par_id2,11,' ',getdate())", conn);

                    cmd.Parameters.Add("@par_id2", SqlDbType.Int).Value = Convert.ToInt32(lb_userid.Text);
                    cmd.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    lb_msg.Text = ex.Message + ex.Source;
                    return;
                }
                ...

I don't know why I've got this error.

Input string was not in a correct format.mscorlib
ASKER CERTIFIED SOLUTION
Avatar of Vel Eous
Vel Eous

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial