有点看不懂啊,她提示你insert into语句语法错误了啊。肯定问题就出在insert into这里,你仔细检查一下,看看数据类型是不是匹配。
解决方案 »
- 求助,关于放在panel中的checkbox选中的问题
- RS232接收的字节少于发送的
- 十万火急!!看看我的这个错误怎么办
- dr.GetString(i)有没有通用类型或怎么转换成string?
- 怎么计算程序中某个函数的执行时间
- 老位老兄打包过.net 2005
- 如何屏蔽半角 及 ,' 输入
- System.ComponentModel.Win32Exception: 系统找不到指定的文件。
- 新人,想学习C#,望帮助!
- 各位如果有一本C#的.NET类库的书觉得它的价值如何?
- 我实在没有办法了,哪位好心人帮帮我吧?:(
- 求Office 2003 英文版+VS2003 英文版+MSDN 最新英文版,谢谢!
string source="server=sim;uid=sa;pwd=;database=demo";
SqlConnection conn=new SqlConnection(source);
conn.Open();
try
{
string bh="01010101";
string xm="smsms";
string select ="insert into tbl_charge_account2004 (bh,xm) values('"+bh+"','"+xm+"')";
Console.WriteLine(select);
//string select="select mzfph,xm from tbl_charge_account2004 order by mzfph for xml auto";
SqlCommand cmd=new SqlCommand(select,conn);
cmd.ExecuteNonQuery();
}
catch(Exception e){
}
conn.Close();