GridView显示不出绑定的数据
private void GetConnect(){
string strCon = " Provider = Microsoft.Jet.OLEDB.4.0;Data Source =E:\\asptest\\work.xls;Extended Properties=Excel 8.0";
OleDbConnection myConn = new OleDbConnection(strCon);
string strCom = "SELECT * FROM [sheet1$]";
myConn.Open();
OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom, myConn);
DataSet myda = new DataSet();
myCommand.Fill(myda,"[sheet1$]");
myConn.Close();
GridView1.DataMember = "[sheet1$]";
GridView1.DataSource = myda;
Response.Write("数据绑定");
}
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
GetConnect();
}
我的配置是vs2008+sql2008+office2003,,,,Excel 8.0改为excel 11.0就说"找不到可安装的 ISAM",Excel 8.0的话没有出错,但是 GridView控件没显示数据,一片空白,请问各位大虾是什么问题啊,谢谢!