ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Edit and Update Image using ASP.Net GridView RowUpdating in C#<p>Actually it is being solved by me..Thnaks</p> <pre class="brush: csharp"> protected void gvImage_RowUpdating(object sender, GridViewUpdateEventArgs e) { //find image id of edit row string Id = gvImage.DataKeys[e.RowIndex].Value.ToString(); // find values for update TextBox BName = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_BName&#34;); TextBox city = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_city&#34;); TextBox name = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_name&#34;); TextBox add = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_add&#34;); TextBox toll = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_toll&#34;); TextBox link = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_link&#34;); TextBox pay = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_pay&#34;); TextBox email = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_email&#34;); TextBox images = (TextBox)gvImage.Rows[e.RowIndex].FindControl(&#34;txt_img&#34;); FileUpload FileUpload1 = (FileUpload)gvImage.Rows[e.RowIndex].FindControl(&#34;FileUpload1&#34;); con = new SqlConnection(constr); string path = &#34;~/uploads/&#34;; string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName); if (FileUpload1.HasFile) { path += FileUpload1.FileName; //save image in folder FileUpload1.SaveAs(MapPath(path)); } else { // use previous user image if new image is not changed Image img = (Image)gvImage.Rows[e.RowIndex].FindControl(&#34;img_user&#34;); path = img.ImageUrl; } SqlCommand cmd = new SqlCommand(&#34;update Q_SP_Afterlogin set Bussiness_name=&#39;&#34; + BName.Text + &#34;&#39;,address=&#39;&#34; + add.Text + &#34;&#39;,Image_name=&#39;&#34; +FileUpload1.FileName+ &#34;&#39;,city=&#39;&#34; + city.Text + &#34;&#39;,name=&#39;&#34; + name.Text + &#34;&#39;,toll_free=&#39;&#34; + toll.Text + &#34;&#39;,website_link=&#39;&#34; + link.Text + &#34;&#39;,payment_mode=&#39;&#34; + pay.Text + &#34;&#39;,email=&#39;&#34; + email.Text + &#34;&#39;,Images=&#39;&#34; + path + &#34;&#39; where Id=&#34; + Id + &#34;&#34;, con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); gvImage.EditIndex = -1; ImageData(); }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/102963/Edit-and-Update-Image-using-ASPNet-GridView-RowUpdating-in-C/https://www.aspforums.net:443/Threads/102963/Edit-and-Update-Image-using-ASPNet-GridView-RowUpdating-in-C/Fri, 26 Jul 2019 00:49:17 GMT