首页上一页 1 下一页尾页 1 条记录 1/1页
ASP.Net项目开发全程实录 第一章
发表在ASP.NET图书答疑
2009-03-13
是否精华
是
否
版块置顶:
是
否
#region 添加收费供求信息
public void insertinfofei(string type, string title, string info, string linkMan, string tel, DateTime sumDay, bool checkState)
{
SqlParameter[] parms ={
data.makeinparam ("@type",SqlDbType.VarChar , 50 ,type),
data.makeinparam ("@title",SqlDbType.VarChar , 50 ,title),
data.makeinparam ("@info",SqlDbType.VarChar , 500 ,info),
data.makeinparam ("@linkMan",SqlDbType.VarChar , 50 ,linkMan),
data.makeinparam ("@tel",SqlDbType.VarChar, 50 ,tel),
data.makeinparam ("@showday",SqlDbType.DateTime , 8 ,sumDay),
data.makeinparam ("@CheckState",SqlDbType.Bit , 8 , checkState)
};
int i = data.runproc ("INSERT INTO tb_LeaguerInfo (type, title, info, linkman, tel,showday,checkState) VALUES (@type, @title,@info,@linkMan, @tel,@showday,@CheckState)", parms);
}
#endregion
每一行都显示:
无法将类型“object”隐式转换为“System.Data.SqlClient.SqlParameter”。存在一个显式转换(是否缺少强制转换?
这是怎么回事?
public void insertinfofei(string type, string title, string info, string linkMan, string tel, DateTime sumDay, bool checkState)
{
SqlParameter[] parms ={
data.makeinparam ("@type",SqlDbType.VarChar , 50 ,type),
data.makeinparam ("@title",SqlDbType.VarChar , 50 ,title),
data.makeinparam ("@info",SqlDbType.VarChar , 500 ,info),
data.makeinparam ("@linkMan",SqlDbType.VarChar , 50 ,linkMan),
data.makeinparam ("@tel",SqlDbType.VarChar, 50 ,tel),
data.makeinparam ("@showday",SqlDbType.DateTime , 8 ,sumDay),
data.makeinparam ("@CheckState",SqlDbType.Bit , 8 , checkState)
};
int i = data.runproc ("INSERT INTO tb_LeaguerInfo (type, title, info, linkman, tel,showday,checkState) VALUES (@type, @title,@info,@linkMan, @tel,@showday,@CheckState)", parms);
}
#endregion
每一行都显示:
无法将类型“object”隐式转换为“System.Data.SqlClient.SqlParameter”。存在一个显式转换(是否缺少强制转换?
这是怎么回事?