foreach (GridViewRow row in GridView1.Rows) { if ((row.FindControl("chkSelect") as CheckBox).Checked) { string dd1 = row.Cells[1].Text; //DropDownList ddl = (DropDownList)row.FindControl("DropDownList1"); int catid = int.Parse(row.Cells[2].Text); DateTime date = DateTime.Parse(row.Cells[3].Text); int dcno =int.Parse( row.Cells[4].Text); string company = row.Cells[5].Text; string name = row.Cells[6].Text; string size = row.Cells[7].Text; string batch = row.Cells[8].Text; DateTime exp = DateTime.Parse(row.Cells[9].Text); dt.Rows.Add(dd1, catid, date, company, name, size, batch, exp); }
int
datetime
date
row.Cells[2].Text
int catid; int.TryParse(row.Cells[2].Text, out catid); DateTime date; DateTime.TryParse(row.Cells[3].Text, out date); int dcno; int.TryParse(row.Cells[4].Text, out dcno);
DateTime dt ; DateTimeStyles dtStyles = DateTimeStyles.None; CultureInfo culture = CultureInfo.CreateSpecificCulture("en-US");; DateTime.TryParse(dateTimeString, culture, dtStyles, out dt);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)