string path = @"C:\Users\deepika.W109\Documents\Visual Studio 2012\Projects\Websitechangesdemo1\dt to excel\Book2.xls";
System.Data.DataTable dt = new System.Data.DataTable();
dt = exceldata(path);
dataGridView1.DataSource = dt;
string[] columnNames = dt.Columns.Cast<DataColumn>()
.Select(x => x.ColumnName)
.ToArray();
DataRow[] dr = dt.Select("Id = '2'");
DateTime Todaydate = DateTime.Today.Date;
string dat = Todaydate.Date.ToString("dd/MM/yyyy");
if (dr.Length > 0)
{
string avalue = dr[0]["Dob"].ToString();
}
No comments:
Post a Comment