TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
maryam mohammadi
NA
4
703
Editing image field in gridview by fileUpload
Jul 1 2015 7:45 AM
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?
Reply
Answers (
2
)
how to delete data from database in webservice
Image Uploading and displaying