پیام حیاتی
شنبه 07 شهریور 1394, 19:11 عصر
سلام
این کدهای من :
string patch1 = "";
if (FileUpload2.HasFile && FileUpload2.PostedFile.ContentLength < 512000)
{
string filename1 = FileUpload2.FileName;
FileUpload2.PostedFile.SaveAs(Server.MapPath("~\\Order_Graphic\\" + filename1));
patch1 = "~\\Order_Graphic\\" + filename1;
}
con.Open();
string Query = "insert into Order_Graphic (g_fullname , g_email , g_phone , g_title , g_pic , g_descrip) values ('" + txt_name.Text + "' , '" + txt_email.Text + "' , '" + txt_phone.Text + "' , '" + drop.SelectedItem + "' , '" + patch1 + "' , '" + txt_descrip.Text + "') ";
SqlCommand com = new SqlCommand(Query, con);
com.ExecuteNonQuery();
con.Close();
خطا :
An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: String or binary data would be truncated.
134723
تشکر.
این کدهای من :
string patch1 = "";
if (FileUpload2.HasFile && FileUpload2.PostedFile.ContentLength < 512000)
{
string filename1 = FileUpload2.FileName;
FileUpload2.PostedFile.SaveAs(Server.MapPath("~\\Order_Graphic\\" + filename1));
patch1 = "~\\Order_Graphic\\" + filename1;
}
con.Open();
string Query = "insert into Order_Graphic (g_fullname , g_email , g_phone , g_title , g_pic , g_descrip) values ('" + txt_name.Text + "' , '" + txt_email.Text + "' , '" + txt_phone.Text + "' , '" + drop.SelectedItem + "' , '" + patch1 + "' , '" + txt_descrip.Text + "') ";
SqlCommand com = new SqlCommand(Query, con);
com.ExecuteNonQuery();
con.Close();
خطا :
An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: String or binary data would be truncated.
134723
تشکر.