我在DAL中已经引用了using model,,model中包含的类却不能用,不知道什么原因 5
我想在基本信息表中增加用户的信息,按理说既然DAL引用了model,而且添加了usingmodel,而model中又有实体类Baseinfo,publicboolInse...
我想在基本信息表中增加用户的信息,按理说既然DAL 引用了model,而且添加了using model,而model中又有实体类Baseinfo ,public bool Insert(Baseinfo b)里的baseinfo应该是蓝色的呀,为什么我这里还是黑色的呢?并且以调试就提示“找不到类型或命名空间baseinfo”
//增加基本信息
public bool Insert(Baseinfo b)
{
bool flag = false;
string sql = "insert into personal_info_list (P_ID,P_name,P_type,P_birthday,P_email,P_sex,P_photo,P_partisan,P_race,P_highest_education,P_post_level,P_administrative_duties,P_job_type,P_job_starting_year,P_job_appointment_year,P_post_name,P_tel,P_fax) values(@P_ID,@P_name,@P_type,@P_birthday,@P_email,@P_sex,@P_photo,@P_partisan,@P_race,@P_highest_education,@P_post_level,@P_administrative_duties,@P_job_type,@P_job_starting_year,@P_job_appointment_year,@P_post_name,@P_tel,@P_fax)";
SqlParameter[] paras = new SqlParameter[]
{
new SqlParameter ("@P_ID",b.P_ID),
new SqlParameter ("@P_name",b.P_name),
new SqlParameter ("@P_type",b.P_type),
new SqlParameter ("@P_birthday",b.P_birthday),
new SqlParameter ("@P_birthday",b.P_birthday),
new SqlParameter ("@P_email",b.P_email),
new SqlParameter ("@P_photo",b.P_photo),
new SqlParameter ("@P_partisan",b.P_partisan),
new SqlParameter ("@P_race",b.P_race),
new SqlParameter ("@P_highest_education",b.P_highest_education),
new SqlParameter ("@P_post_level",b.P_post_level),
new SqlParameter ("@P_administrative_duties",b.P_administrative_duties),
new SqlParameter ("@P_job_type",b.P_job_type),
new SqlParameter ("@P_job_starting_year",b.P_job_starting_year),
new SqlParameter ("@P_job_appointment_year",b.P_job_appointment_year),
new SqlParameter ("@P_post_name",b.P_post_name),
new SqlParameter ("@P_tel",b.P_tel),
new SqlParameter ("@P_fax",b.P_fax),
};
int res = sqlhelper.ExecuteNonQuery(sql, paras);
if (res > 0)
{
flag = true;
}
return flag;
} 展开
//增加基本信息
public bool Insert(Baseinfo b)
{
bool flag = false;
string sql = "insert into personal_info_list (P_ID,P_name,P_type,P_birthday,P_email,P_sex,P_photo,P_partisan,P_race,P_highest_education,P_post_level,P_administrative_duties,P_job_type,P_job_starting_year,P_job_appointment_year,P_post_name,P_tel,P_fax) values(@P_ID,@P_name,@P_type,@P_birthday,@P_email,@P_sex,@P_photo,@P_partisan,@P_race,@P_highest_education,@P_post_level,@P_administrative_duties,@P_job_type,@P_job_starting_year,@P_job_appointment_year,@P_post_name,@P_tel,@P_fax)";
SqlParameter[] paras = new SqlParameter[]
{
new SqlParameter ("@P_ID",b.P_ID),
new SqlParameter ("@P_name",b.P_name),
new SqlParameter ("@P_type",b.P_type),
new SqlParameter ("@P_birthday",b.P_birthday),
new SqlParameter ("@P_birthday",b.P_birthday),
new SqlParameter ("@P_email",b.P_email),
new SqlParameter ("@P_photo",b.P_photo),
new SqlParameter ("@P_partisan",b.P_partisan),
new SqlParameter ("@P_race",b.P_race),
new SqlParameter ("@P_highest_education",b.P_highest_education),
new SqlParameter ("@P_post_level",b.P_post_level),
new SqlParameter ("@P_administrative_duties",b.P_administrative_duties),
new SqlParameter ("@P_job_type",b.P_job_type),
new SqlParameter ("@P_job_starting_year",b.P_job_starting_year),
new SqlParameter ("@P_job_appointment_year",b.P_job_appointment_year),
new SqlParameter ("@P_post_name",b.P_post_name),
new SqlParameter ("@P_tel",b.P_tel),
new SqlParameter ("@P_fax",b.P_fax),
};
int res = sqlhelper.ExecuteNonQuery(sql, paras);
if (res > 0)
{
flag = true;
}
return flag;
} 展开
2个回答
展开全部
你在DAL里引用了Model的dll了吗?
追问
我查过自己出现的这个问题,他们说要把model重新编译一下才能出现model.dll,但我不知道怎么重新编译啊?我的QQ号是1907234202,如果方便的话在线聊吧,我这个项目后面肯定还会碰到很多问题,想多请教一下。
追答
你加我吧,1413453648
你在你的Model工程上进行重新编译,之后debug文件下就会生成相应的dll,然后在需要用到Model层的地方引用这个dll就可以了。如果还不可以,可你把工程传过来我给你看看
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
变量还没赋值
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询