错误:当前上下文中不存在名称“data”,麻烦各位帮我看下下面的代码有没有出错,还是要加什么
usingSystem.Data.OleDb;//所加的头文件publicintAddAdmin(AdminManageadminmanage){OleDbParamet...
using System.Data.OleDb;//所加的头文件
public int AddAdmin(AdminManage adminmanage)
{
OleDbParameter[] prams ={
data.MakeInParam("@id",OleDbType.VarChar,50,adminmanage.ID),
data.MakeInParam("@name",OleDbType.VarChar,50,adminmanage.Name),
data.MakeInParam("@pwd",OleDbType.VarChar,50,adminmanage.Pwd),
};
return (data.RunProc("inset into tb_admin(id,name,pwd) values(@id,@name,@pwd)", prams));
} 展开
public int AddAdmin(AdminManage adminmanage)
{
OleDbParameter[] prams ={
data.MakeInParam("@id",OleDbType.VarChar,50,adminmanage.ID),
data.MakeInParam("@name",OleDbType.VarChar,50,adminmanage.Name),
data.MakeInParam("@pwd",OleDbType.VarChar,50,adminmanage.Pwd),
};
return (data.RunProc("inset into tb_admin(id,name,pwd) values(@id,@name,@pwd)", prams));
} 展开
2个回答
展开全部
using System.Data.OleDb;//所加的头文件
public int AddAdmin(AdminManage adminmanage)
{
用户的数据处理类 data = new 用户的数据处理类(); // 用户的数据处理类 具体是什么你懂的
OleDbParameter[] prams =
{
data.MakeInParam("@id", OleDbType.VarChar,50,adminmanage.ID),
data.MakeInParam("@name", OleDbType.VarChar,50,adminmanage.Name),
data.MakeInParam("@pwd", OleDbType.VarChar,50,adminmanage.Pwd),
};
return (data.RunProc("inset into tb_admin(id,name,pwd) values(@id,@name,@pwd)", prams));
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询