Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Editing image field in gridview by fileUpload
maryam mohammadi
Jul 1 2015 7:45 AM
470
Reply
Hi
I have two columns in gridview which I want to use template for editing them( web column and image column)
for web column editing I used two textBox as template.one for name of web and another for address.
the code is here:
string siteNm = ((TextBox)GridView1.Rows[e.RowIndex].Cells[16].Controls[1]).Text;
string siteAddr = ((TextBox)GridView1.Rows[e.RowIndex].Cells[16].Controls[3]).Text;
and for updating information
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings[2].ToString());
SqlCommand cmd = new SqlCommand("update students set stu_img=@7, stu_web_name=@8 , stu_web_addr=@9", con);
cmd.Parameters.AddWithValue("@8", siteNm);
cmd.Parameters.AddWithValue("@9", siteAddr);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
GridView1.EditIndex = -1;
sel();
Now I want to edit image column by fileUpload...I don't know how to write code of this?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
how to delete data from database in webservice
Image Uploading and displaying