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
chiranjeevi mugibari
1.2k
230
8.6k
Display GridError
Aug 28 2015 7:09 AM
DataTable dt = new DataTable();
dt.Columns.Add("ItemRowId", typeof(int));
dt.Columns.Add("ItemCode", typeof(string));
dt.Columns.Add("ItemName", typeof(string));
dt.Columns.Add("MRP", typeof(float));
dt.Columns.Add("tur", typeof(float));
dt.Columns.Add("UPC", typeof(float));
foreach (GridViewRow row in xdata.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
CheckBox chkSelect = (row.Cells[0].FindControl("chkSelect") as CheckBox);
if (chkSelect.Checked)
{
int ItemRowId = int.Parse(row.Cells[1].Text);
string ItemCode = row.Cells[2].Text;
string ItemName = row.Cells[3].Text;
float MRP = float.Parse(row.Cells[4].Text);
float tur = float.Parse(row.Cells[5].Text);
float UPC = float.Parse(row.Cells[6].Text);
dt.Rows.Add(ItemRowId, ItemCode, ItemName, MRP, tur);
}
}
}
Session.Add("dtgetselectedRecords", dt);
Server.Transfer("~/Grid2.aspx");
It is in float format and it accepts null values.
showing error : input string was not in correct format
Reply
Answers (
2
)
i want paymentamount column in desc order
Get Websites in C#.NET