日期:2014-05-17 浏览次数:21083 次
异常详细信息: System.InvalidOperationException: 数据源的类型无效。它必须是 IListSource、IEnumerable 或 IDataSource。
源错误:
行 198: GridView child = (GridView)e.Row.FindControl("gvChild");
行 199:
行 200: child.DataSource =myapp1;
行 201: child.DataBind();
protected void gvParent_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string sqlApp1 = "select pono from po_approver where pono='" + e.Row.Cells[2].Text+"' ";
MySqlCommand mySqlApp1 = new MySqlCommand(sqlApp1, myConnection);
MySqlDataAdapter myapp1 = new MySqlDataAdapter(mySqlApp1);
DataSet myap1 = new DataSet();
myapp1.Fill(myap1);
GridView child = (GridView)e.Row.FindControl("gvChild");
child.DataSource =myapp1;
child.DataBind();
}
}