我正在使用 gridview 的排序功能并收到上述错误
我的排序功能是
protected void gvUserMaster_Sorting(object sender, GridViewSortEventArgs e)
{
UserMasterClass cs = new UserMasterClass();
ResultClass objres = cs.fn_GetUserMasterList();
if (objres.bStatus)
{
eslist<UserMasterClass> OBJLIST = objres.objData as eslist<UserMasterClass>;
if (OBJLIST.Count > 0)
{
DataTableConverter<UserMasterClass> dt = new DataTableConverter<UserMasterClass>();
dt.GetDataTable(OBJLIST);
if (dt != null)
{
DataView dataView = new DataView(dt);
dataView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);
gvUserMaster.DataSource = dataView;
gvUserMaster.DataBind();
}
}
}
}
我在这一行收到错误 DataView dataView = new DataView(dt);
谢谢,