无法将类型void隐式转换为System.Data.DataSet
publicpartialclassPersonal_Assessment:SecPageBase{//privateDataSetds_monthassess;prot...
public partial class Personal_Assessment : SecPageBase
{
//private DataSet ds_monthassess;
protected void Page_Load(object sender, EventArgs e)
{
LoadMonthAssess();
LoadDailyAssess();
LoadTotalAssess();
}
protected void LoadMonthAssess()
{
DataSet ds_monthassess = new DataSet();
ds_monthassess = cf.QueryMonthAssessInfo(ref ds_monthassess, userInfo.p_code);
GV_month.DataSource = ds_monthassess;
GV_month.DataBind();
}
protected void LoadDailyAssess()
{
DataSet ds_dailyassess = new DataSet();
ds_dailyassess = cf.QueryDailyAssessInfo(ref ds_dailyassess, userInfo.p_code);
GV_daily.DataSource = ds_dailyassess;
GV_daily.DataBind();
}
protected void LoadTotalAssess()
{
DataSet ds_totalassess = new DataSet();
ds_totalassess = cf.QueryTotalAssessInfo(ref ds_totalassess, userInfo.p_code);
GV_total.DataSource = ds_totalassess;
GV_total.DataBind();
}
} 展开
{
//private DataSet ds_monthassess;
protected void Page_Load(object sender, EventArgs e)
{
LoadMonthAssess();
LoadDailyAssess();
LoadTotalAssess();
}
protected void LoadMonthAssess()
{
DataSet ds_monthassess = new DataSet();
ds_monthassess = cf.QueryMonthAssessInfo(ref ds_monthassess, userInfo.p_code);
GV_month.DataSource = ds_monthassess;
GV_month.DataBind();
}
protected void LoadDailyAssess()
{
DataSet ds_dailyassess = new DataSet();
ds_dailyassess = cf.QueryDailyAssessInfo(ref ds_dailyassess, userInfo.p_code);
GV_daily.DataSource = ds_dailyassess;
GV_daily.DataBind();
}
protected void LoadTotalAssess()
{
DataSet ds_totalassess = new DataSet();
ds_totalassess = cf.QueryTotalAssessInfo(ref ds_totalassess, userInfo.p_code);
GV_total.DataSource = ds_totalassess;
GV_total.DataBind();
}
} 展开
1个回答
展开全部
你都没说错在哪一行。。。
不过根据你的程序,我猜测
ds_monthassess = cf.QueryMonthAssessInfo(ref ds_monthassess, userInfo.p_code);
ds_dailyassess = cf.QueryDailyAssessInfo(ref ds_dailyassess, userInfo.p_code);
ds_totalassess = cf.QueryTotalAssessInfo(ref ds_totalassess, userInfo.p_code);
这3行代码可能会产生以上错误。
以第一行为例。ds_monthassess是System.Data.DataSet类型,后面的cf.QueryMonthAssessInfo(ref ds_monthassess, userInfo.p_code)这个方法可能类型定义为void无返回类型。所以强制转换的时候会报错
不过根据你的程序,我猜测
ds_monthassess = cf.QueryMonthAssessInfo(ref ds_monthassess, userInfo.p_code);
ds_dailyassess = cf.QueryDailyAssessInfo(ref ds_dailyassess, userInfo.p_code);
ds_totalassess = cf.QueryTotalAssessInfo(ref ds_totalassess, userInfo.p_code);
这3行代码可能会产生以上错误。
以第一行为例。ds_monthassess是System.Data.DataSet类型,后面的cf.QueryMonthAssessInfo(ref ds_monthassess, userInfo.p_code)这个方法可能类型定义为void无返回类型。所以强制转换的时候会报错
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询