View Single Post
Old 08-22-2011, 10:02 AM   #3
f8d3gfdy
 
Posts: n/a
Default

protected void Button1_Click (object sender, EventArgs e)
{
string excelFilePath = @ \jbnt1.xls \; object oMissing = System.Reflection.Missing.Value;
myExcel.Application.Workbooks.Open (excelFilePath, oMissing, oMissing,air force one shoes, oMissing ,nike air force, oMissing, oMissing,air force 1 classic mid, oMissing,nike air force one low, oMissing,air force 1, oMissing, oMissing, oMissing, oMissing,air force 1 shoes, oMissing, oMissing, oMissing);
Excel.Workbook myBook = myExcel. Workbooks [1];
Excel.Worksheet mySheet = (Excel.Worksheet) myBook.Worksheets [1];
System.Data.DataTable dt = new System.Data.DataTable (\. Columns.Add (\\System.Type.GetType (\(\String \; myDs.Tables.Add (dt);
DataRow myRow;
; myDs.Clear ();
for (int i = 2; i <= 9; i + +) / / title of the first act, do not read take
{
myRow = myDs.Tables [\; = 5; j + +)
{
; Excel.Range r = (Excel.Range) mySheet.Cells;
string strValue = r.Text.ToString ();
string aa = strValue;
string columnname = \; myRow [columnname] = strValue;
}
; myDs.Tables [\;}
GridView1.DataSource = myDs.Tables [\GridView1.DataBind ();
}
  Reply With Quote

Sponsored Links