SqlCommand myCommand = new SqlCommand(); 中的SqlCommand(); ,是不是少了个参数??你只有myCommand .CommandText,那另一个的数据库的连接串呢??是不是忘写了??我一般这个地方会这样写,省的忘:SqlConnection sqlconn = new SqlConnection(); sqlconn.ConnectionString = "server=192.168.2.9; uid=sa; pwd=123456; database=Example"; string stSql="insert into dbo.rigister(姓名,性别,年龄,祖籍,现在所住地,移动电话,固定电话,邮箱,求职岗位,学历,毕业院校,技能,工作经验,自我评定)VALUES (@name,@sex,@age,@homeplace,@nowplace,@mobilephone,@fixphone,@email,@profile,@education,@graduation,@skill,@expirence,@remark)";
SqlCommand comm = new SqlCommand(sql, sqlconn);SqlCommand myCommand = new SqlCommand(stSql,sqlconn); 我也好久没写过这样的语句了,也不知道我说的是对还是错。。没有环境不能调试。如果错了,不要骂我哦,呵呵
|