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
Gopal Ji Singh
NA
39
31.8k
Getting error on row command of GridView
Sep 28 2013 10:46 AM
Hello every one
i m getting an error(
Input string was not in a correct format.
) on click of detail button please help me to resolve this problem.
my code is
protected void grdexam_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "dtls")
{
Button btn = (Button)e.CommandSource;
var index =Convert.ToInt32(btn.CommandArgument.ToString());
GridViewRow row = grdexam.Rows[index];
Label l1 = (Label)row.FindControl("Label1");
SqlCommand cmd = new SqlCommand("select * from ExamMaster where groupid='" + Session["grpid"] + "' and papercode='" + l1 + "'", con);
SqlDataAdapter adp = new SqlDataAdapter();
DataTable dt = new DataTable();
adp.Fill(dt);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
Response.Write("wromg");
}
}
}
please help me
thanks in advance
Reply
Answers (
2
)
how to read Text file with more than 30000 lines
Changing date at run time using calendar extender.