问题描述
数据访问层编码如下
公共DataSet SessionDataset(字符串FN,字符串PWD,字符串EMAIL)
{
con.Open();
cmd = new SqlCommand(SP_SessionByDataset,con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(@ fname,FN);
cmd.Parameters.AddWithValue(@ pwd,PWD);
cmd .Parameters.AddWithValue(@ Email,EMAIL);
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
con.Close();
返回ds;
}
商业逻辑层编码如下
公共DataSet SessionDataset(字符串FN,字符串PWD,字符串EMAIL)
{
DataSet ds = d.SessionDataset( );
返回ds;
}
我收到这样的错误
没有超载方法SessionDataset需要0参数
如何清除此错误....
在此先感谢...
Data Access Layer Coding as below
public DataSet SessionDataset(string FN,string PWD,string EMAIL)
{
con.Open();
cmd = new SqlCommand("SP_SessionByDataset", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@fname",FN);
cmd.Parameters.AddWithValue("@pwd",PWD);
cmd.Parameters.AddWithValue("@Email",EMAIL);
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds);
con.Close();
return ds;
}
Business Logic Layer coding as below
public DataSet SessionDataset(string FN, string PWD, string EMAIL)
{
DataSet ds = d.SessionDataset();
return ds;
}
I am getting error like this
"No overload for method SessionDataset takes 0 arguments"
How to clear this error ....
Thanks in advance...
推荐答案
DataSet ds = d.SessionDataset();
应该像
Should be something like
DataSet ds = d.SessionDataset(FN, PWD, EMAIL);
,据说我不确定你的'业务层'实际上是做什么/意味着实现
'g'
that being said Im not sure what your 'business layer' is actually doing/meant to achieve
'g'
这篇关于重载方法问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!