protected void btnUpdate_Click(object sender, EventArgs e)
{
string id = Request.QueryString["id"].ToString();
string qry = "update appformtbl set can_name=@can_name,fath_name=@fath_name,photo=@photo,sign=@sign,pass_gra=@pass_gra where id=" + id + "";
SqlConnection con = new SqlConnection(connection);
SqlCommand cmd = new SqlCommand(qry, con);
if (image1.HasFile)
{
image1.SaveAs(MapPath("~/Rimage/" + image1.FileName));
System.Drawing.Image img1 = System.Drawing.Image.FromFile(MapPath("~/Rimage/") + image1.FileName);
NormalImage.ImageUrl = "~/Rimage/" + image1.FileName;
}
else
{
var preimg = cmd.Parameters.AddWithValue("@photo", image1.ToString());
if (image1!= null)
{
preimg.Value = image1.FileName;-
}
}
cmd.Parameters.AddWithValue("@photo", SqlDbType.NVarChar).Value = image1.FileName.Trim();
my problem:- hello friends, when i am updating new image then show in table but without change image click on update button then not find previous image... how to do it??? please help me.. thank you
Nitin SontakkeRank #264 · 9.6K reputationPosted Mar 15, 2018, 10:15 PM EDT
Kaushik DhameliyaRank #1,518 · 1K reputationPosted Mar 15, 2018, 9:54 PM EDT
Ankita Singh176 reputationPosted Mar 15, 2018, 9:59 PM EDT
Ankita Singh176 reputationPosted Mar 15, 2018, 10:01 PM EDT
Kaushik DhameliyaRank #1,518 · 1K reputationPosted Mar 15, 2018, 10:03 PM EDT
Ankita Singh176 reputationPosted Mar 15, 2018, 10:11 PM EDT
Ankita Singh176 reputationPosted Mar 15, 2018, 10:25 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Mar 15, 2018, 10:41 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts