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
satya swaroop
NA
1
780
Deleting Multiple rows in a GridView
May 14 2016 8:08 AM
protected void Button1_Click(object sender, EventArgs e)<br /> {<br /> foreach (GridViewRow grow in GridView1.Rows)<br /> {<br /> CheckBox chk = (CheckBox)grow.FindControl("chk1");<br /> if (chk.Checked)<br /> {<br /> int empid =Convert.ToInt32(grow.Cells[1].Text);<br /> deleterecord(empid);<br /> }<br /> }<br /> Bind();<br /> }<br /> protected static void deleterecord(int empid)<br /> {<br /> SqlConnection con = new SqlConnection("Data Source=desktop-tvrrh2v;Initial Catalog=FROMSQL;Integrated Security=True");<br /> SqlCommand cmd = new SqlCommand("delete from grrid where id=@id", con);<br /> cmd.Parameters.AddWithValue("@id",empid);<br /> con.Open();<br /> cmd.ExecuteNonQuery();<br /> con.Close();<br /> }<div></div><div> }</div>
Attachment:
WebApplication18.rar
Reply
Answers (
2
)
IIS, VM, AZURE. Configure web.config file classic ASP.NET.
Bind country,state,city Through cultureinfo not use of datab