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 SontakkePosted Mar 16, 2018, 2:15 AM
Nitin SontakkePosted Mar 16, 2018, 2:41 AM
Ankita SinghPosted Mar 16, 2018, 2:25 AM
Ankita SinghPosted Mar 16, 2018, 2:11 AM
Kaushik DhameliyaPosted Mar 16, 2018, 2:03 AM
Ankita SinghPosted Mar 16, 2018, 2:01 AM
Ankita SinghPosted Mar 16, 2018, 1:59 AM
Kaushik DhameliyaPosted Mar 16, 2018, 1:54 AM