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
hothorasman panjaitan
NA
123
19.9k
hello master .net why if I update fileupload1, then FileUplo
Feb 11 2015 1:19 AM
pleas helpme
this my code
protected void Updatedata(object sender, GridViewUpdateEventArgs e)
{
FileUpload FileUpload1 = (FileUpload)GridView1.Rows[e.RowIndex].FindControl("FileUpload1");
FileUpload FileUpload2 = (FileUpload)GridView1.Rows[e.RowIndex].FindControl("FileUpload2");
string id_peraturan = GridView1.DataKeys[e.RowIndex].Value.ToString();
string path1 = "Pembentukan/";
string path2 = "Pengelolaan/";
if (FileUpload1.HasFile)
{
path1 += FileUpload1.FileName;
FileUpload1.SaveAs(MapPath(path1));
}
if (FileUpload2.HasFile)
{
path2 += FileUpload2.FileName;
FileUpload2.SaveAs(MapPath(path2));
}
MySqlConnection con = new MySqlConnection(strConnString);
MySqlCommand cmd = new MySqlCommand("UPDATE tbl_peraturan SET perda_pembentukan='" + path1 + "',perda_pengelolaan='"+ path2 +"' WHERE id_peraturan=" + id_peraturan + "", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close()
GridView1.EditIndex = -1;
tampilgird();
Response.Redirect(Request.Url.AbsoluteUri);
}
Reply
Answers (
4
)
drop down bind
Eval function not working?