S
saqsaqPK
Guest
Kindly Advise whats wrong
protected void btnUpload_Click(object sender, EventArgs e)
{
string path = Server.MapPath(@"Images/Misc/Installation_Certificate/");
if (FileImgesave.PostedFile != null)
{
string imgfile = Path.GetFileName(FileImgesave.PostedFile.FileName);
// FileImgesave.SaveAs(path + imgfile);
FileImgesave.SaveAs(path + comboxSerial.Value + "_" + imgfile);
string name = (@"Images/Misc/Installation_Certificate/" + comboxSerial.Value + "_" + imgfile);
SqlConnection connn = new SqlConnection(ConfigurationManager.ConnectionStrings["SECODMSConnectionString"].ConnectionString);
connn.Open();
string UpdateQuery = "insert tbl_Instrument_detail (tbl_upload_Installaion_doc) WHERE tbl_Instrument_Serial =" + comboxSerial.Value + " values (@ImgPath)";
SqlCommand com = new SqlCommand(UpdateQuery, connn);
com.Parameters.AddWithValue("@ImgPath", name);
com.ExecuteNonQuery();
Response.Redirect(Request.Url.AbsoluteUri);
Response.Write("Thank you investing your precious time on us");
connn.Close();
}
else
{
}
show error when we upload image
Continue reading...
protected void btnUpload_Click(object sender, EventArgs e)
{
string path = Server.MapPath(@"Images/Misc/Installation_Certificate/");
if (FileImgesave.PostedFile != null)
{
string imgfile = Path.GetFileName(FileImgesave.PostedFile.FileName);
// FileImgesave.SaveAs(path + imgfile);
FileImgesave.SaveAs(path + comboxSerial.Value + "_" + imgfile);
string name = (@"Images/Misc/Installation_Certificate/" + comboxSerial.Value + "_" + imgfile);
SqlConnection connn = new SqlConnection(ConfigurationManager.ConnectionStrings["SECODMSConnectionString"].ConnectionString);
connn.Open();
string UpdateQuery = "insert tbl_Instrument_detail (tbl_upload_Installaion_doc) WHERE tbl_Instrument_Serial =" + comboxSerial.Value + " values (@ImgPath)";
SqlCommand com = new SqlCommand(UpdateQuery, connn);
com.Parameters.AddWithValue("@ImgPath", name);
com.ExecuteNonQuery();
Response.Redirect(Request.Url.AbsoluteUri);
Response.Write("Thank you investing your precious time on us");
connn.Close();
}
else
{
}
show error when we upload image
Continue reading...