string SQL = "select * from [Sheet1$]";
DataSet ds = new DataSet();
string strConnection = "";
strConnection = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0",
File_path);
OleDbConnection conn = new OleDbConnection(strConnection);
conn.Open();
OleDbDataAdapter data = new OleDbDataAdapter(SQL, conn);
data.Fill(ds);
dgv.DataSource = ds.Tables[0].DefaultView;
time = new double[dgv.RowCount - 1];
dgv.Refresh();
conn.Close();
现在我得到了一个time数组,如何将time数组在datagriview中显示出来,就是在已有的列表后面新添加一列,来显示time中的数据?
DataSet ds = new DataSet();
string strConnection = "";
strConnection = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0",
File_path);
OleDbConnection conn = new OleDbConnection(strConnection);
conn.Open();
OleDbDataAdapter data = new OleDbDataAdapter(SQL, conn);
data.Fill(ds);
dgv.DataSource = ds.Tables[0].DefaultView;
time = new double[dgv.RowCount - 1];
dgv.Refresh();
conn.Close();
现在我得到了一个time数组,如何将time数组在datagriview中显示出来,就是在已有的列表后面新添加一列,来显示time中的数据?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货