这个SQL句子如何改? - MS-SQL Server / 疑难问题
string strSqltime = "insert into tblcurrenttime (currenttime,term,modifytime)Values('" +comboBox1.SelectedItem+ "','" +comboBox2.SelectedItem+ "','" +DateTime.Now+ "')";
报错呀,',' 附近有语法错误。
strsqltime值为:insert into tblcurrenttime (currenttime,term,modifytime)Values('System.Data.DataRowView','下学期','2010-5-5 0:54:47')
comboBox1中的项是从数据库绑定上去的值,是2009-2010,类型是nvarchar(9)调试出来是:System.Data.DataRowView。如何办呀,请诸大师们。
term后面的逗号要是英文状态下的半角逗号。
string strSqltime = "insert into tblcurrenttime (currenttime,term,modifytime)Values('" +comboBox1.SelectedItem+ "','" +comboBox2.SelectedItem+ "','" +DateTime.Now+ "')";
这是修改后的,你试试。
string strSqltime = "insert into tblcurrenttime (currenttime,term,modifytime)Values('" +comboBox1.SelectedItem+ "','" +comboBox2.SelectedItem+ "','" +DateTime.Now+ "')";
不行呀。
将截断字符串或二进制数据。
语句已终止。
再运行下面这句:
SQL code:
alter table tblcurrenttime alter column ter
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
从数据库中查询一张表的数据
select 部门,姓名 from tb
如何才能生成下面的xml格式
XML code:
<folder state="unchecked" label="全部">
<folder state="unchecked&qu ......
现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......
tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......