请教大虾apache+asp.net2环境 gridview无法动态绑定问题(200分)
环境apache + mod_aspdotnet r2
想使用gridview显示数据,与dataset绑定时无效,测试dataset里有数据。
同样的方法在winform下有效,在iis下也可以,请大虾指点迷津,非常感谢
代码如下:
aConnection = new SqlConnection(getConnectionString());
aAdapter = new SqlDataAdapter();
aHRDataSet = new DataSet();
SqlCommand aSqlCommand = new SqlCommand();
aSqlCommand.Connection = aConnection;
aConnection.Open();
aSqlCommand.CommandText = "select * from creHR";
aAdapter.SelectCommand = aSqlCommand;
aAdapter.Fill(aHRDataSet);
aConnection.Close();
//关键是下面两句,这么用好像不行
GridView1.DataSource = aHRDataSet.Tables[0];
GridView1.DataBind();