i working on asp.net 2.0 and my database is sql server 2005
i am getting error
STRING OR BINARY DATA WOULD BE TRUNCATED THE STATEMENT HAS BEEN TERMINATED
ON line
cmdRegister.ExecuteNonQuery();
THIS MY CODE
protected void cmdRegisterme_Click(object sender, EventArgs e)
{
lblAmount .Text = HFamount .Value ;
string sqlquery;
sqlquery = "INSERT INTO CUSTOMER_DETAILS VALUES(@CUSTOMER_NAME,@CUSTOMER_LAST_NAME,@DATE_OF_BIRTH,@CUSTOMER_GENDER,@CUSTOMER_ADDRESS,@CUSTOMER_EMAIL_ID,@CUSTOMER_OCCUPATION,@CUSTOMER_ACCOUNT_TYPE,@CUSTOMER_ID,@ACCOUNT_NUMBER,@TRANSFER_ACCESS_CODE,@CUSTOMER_PHONE_NUMBER,@NATIONALITY,@PASSWORD, @LOGIN_END_TIME,@CUSTOMER_ACCOUNT_BALANCE)";
SqlConnection mycon = new SqlConnection("Data Source=CG_SOFTWARES\\SQLEXPRESS;Initial Catalog=ONLINE_BANKING;Persist Security Info=True;User ID=sa;Password=123;");
SqlCommand cmdRegister= new SqlCommand(sqlquery, mycon);
mycon.Open();
cmdRegister.Parameters.Add(new SqlParameter ("@CUSTOMER_NAME",txtcustname.Text));
cmdRegister.Parameters.Add(new SqlParameter("@CUSTOMER_LAST_NAME", txtcustlastname.Text));
cmdRegister.Parameters.Add(new SqlParameter("@DATE_OF_BIRTH", txtDOB.Text));
cmdRegister.Parameters.Add(new SqlParameter("@CUSTOMER_GENDER", rbtngender.SelectedItem .Value .ToString()));
cmdRegister.Parameters.Add(new SqlParameter("@CUSTOMER_ADDRESS", txtAddress.Text));
cmdRegister.Parameters.Add(new SqlParameter("@CUSTOMER_EMAIL_ID", txtemail.Text));
cmdRegister.Parameters.Add(new SqlParameter("@CUSTOMER_OCCUPATION", txtcustoccupation.Text));
cmdRegister.Parameters.Add(new SqlParameter("@CUSTOMER_ACCOUNT_TYPE", accType.SelectedItem.Value.ToString()));
cmdRegister.Parameters.Add(new SqlParameter ("@CUSTOMER_ID",CUSTOMER_ID_GENERATOR()));
cmdRegister.Parameters.Add(new SqlParameter("@ACCOUNT_NUMBER", ACCOUNT_NUMBER_GENERATOR()));
cmdRegister.Parameters.Add (new SqlParameter("@TRANSFER_ACCESS_CODE",Transfer_code ()));
cmdRegister.Parameters.Add (new SqlParameter ("@CUSTOMER_PHONE_NUMBER",txtphone.Text.ToString() ));
cmdRegister.Parameters.Add (new SqlParameter ("@NATIONALITY",DropCountry .SelectedItem .Value .ToString()));
cmdRegister.Parameters.Add (new SqlParameter ("@PASSWORD",txtpasswd2.Text ));
cmdRegister.Parameters.Add (new SqlParameter ("@LOGIN_END_TIME",DateTime .Now .ToLongDateString()));
cmdRegister.Parameters.Add (new SqlParameter ("@CUSTOMER_ACCOUNT_BALANCE",lblAmount .Text )) ;
cmdRegister.ExecuteNonQuery();
cmdRegister.Dispose();
mycon.Close();
Response.Write("alert('YOUR INFORMATION IS SAVED')");
}
hfamount.value = "00000"
my CUSTOMER_ACCOUNT_BALANCE column is having datatype bigint
PLEASE HELP ME OUT