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
Noms Nom
1.5k
218
805
input string was not in correct format .....
May 17 2019 11:49 AM
public partial class checkbox4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GridView1.DataSource = SqlDataSource1;
GridView1.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox status = (row.Cells[3].FindControl("CheckBox1") as CheckBox);
int app_id = Convert.ToInt32(row.Cells[1].Text);
if (status.Checked)
{
updaterow(app_id, "A");
}
else
{
updaterow(app_id, "N");
}
}
Label1.Text = "Applications Has Been Approved Successfully";
SqlDataSource1.DataBind();
GridView1.DataSource = SqlDataSource1;
GridView1.DataBind();
}
private void updaterow(int app_id, String status)
{
String mycon = "Data Source=DESKTOP-F60JREG\\SQLEXPRESS;Initial Catalog=testhrm;Integrated Security=True";
String updatedata = "Update tbl_data set status='" + status + "' where id=" + app_id;
SqlConnection con = new SqlConnection(mycon);
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = updatedata;
cmd.Connection = con;
cmd.ExecuteNonQuery();
}
}
Reply
Answers (
5
)
How to generate excel format using json data in web API
Upload File to another location