-1
SqlConnection con=new SqlConnection("Data Source=PRAVESH-PC\\SQLEXPRESS;Initial Catalog=shopping;Integrated Security=True");
string a, b;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void b1_Click(object sender, EventArgs e)
{
a = Class1.GetRandomPassword(10).ToString();
f1.SaveAs(Request.PhysicalApplicationPath+"./images/" + a + f1.FileName.ToString());
b="images/" + a + f1.FileName.ToString();
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into product values('"+t1.Text+"','"+t2.Text+"','"+t3.Text+"','"+t4.Text+",'"+b.ToString()+"')";
cmd.ExecuteNonQuery(); ///// Error Occured..
con.Close();
}
}
,它提供了錯誤:當我在我的項目使用此下面的代碼是當我在我的項目使用此代碼提供了錯誤
Error Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'images'. Unclosed quotation mark after the character string ')'.
任何人都可以請幫我的。
感謝