从数据类型varchar转换为numeric时出错,C#中把多个TextBox中的数据添加到SQL表中作为新纪录请高手们指导
关键代码:sql=String.Format("INSERTINTO工时增补登记(ID,PDN,MBBDBM,JSRQ,BDGS,ZRBM,GSXFRQ,MGGSHBDL...
关键代码:
sql = String.Format("INSERT INTO 工时增补登记(ID,PDN,MBBDBM,JSRQ,BDGS,ZRBM,GSXFRQ,MGGSHBDL,HGGSHBDL,Mark) Values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}')", ZBBH, PDN, MB, jsshj, MS, zrbm, xfrq, mggs, hggs, bzh);
SqlCommand command = new SqlCommand(sql, connection);
int count = command.ExecuteNonQuery();(运行到这一句时出错)
数据库表结构如图 展开
sql = String.Format("INSERT INTO 工时增补登记(ID,PDN,MBBDBM,JSRQ,BDGS,ZRBM,GSXFRQ,MGGSHBDL,HGGSHBDL,Mark) Values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}')", ZBBH, PDN, MB, jsshj, MS, zrbm, xfrq, mggs, hggs, bzh);
SqlCommand command = new SqlCommand(sql, connection);
int count = command.ExecuteNonQuery();(运行到这一句时出错)
数据库表结构如图 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询