How to create effective ajax table in asp.net
Having problem in adding data from dropdown list and saving it in sql server
(a). In my .aspx web page i have
First Name
Last Name
Gender
Email(b) Gender is taken by dropdown list
(c) When you run the code male/female should save to Sql database server
following is the codeSqlConnection SqlConn = new SqlConnection(); SqlConn.ConnectionString = ConfigurationManager.AppSettings["SqlConn"].ToString(); SqlConn.Open(); cmd = new SqlCommand("insert into tbl_info values('" + "" + txt_firstname.Text + "','" + txt_lastname.Text + "','" + dpl_gender.SelectedItem.Text + "','" + txt_email.text + "')", SqlConn); cmd.ExecuteNonQuery();
Now i am getting an error please can anyone identify what is the error
Error is: String or binary data would be truncated. The statement has been terminated.
Red Line on: cmd.ExecuteNonQuery();