请教sql语句拼接的问题 - .NET技术 / C#
例如我现在在数据库中有这么几条数据:学号,姓名,班级,班主任ID,出生日期
我在查询学生信息界面中要求可以根据以上5条数据中的任意一项或多项查询出数据
我自己写的sql语句拼接如下:
C# code:
string strsql = "select * from stu where ";
if (stuNum != "")
{
strsql += "stuNum like '%" + stuNum + "%' and ";
}
else
{
strsql += "stuNum like '%%' and ";
}
if (stuName != "")
{
strsql += "stuName ='" + stuName + "' and ";
}
if (beginDate != "")
{
strsql += "createdate>=to_date('" + beginDate + " 00:00:00 " + "','yyyy-mm-dd hh24:mi:ss')" + " and ";
}
if (endDate != "")
{
strsql += "createdate<=to_date('" + endDate + " 23:59:59 " + "','yyyy-mm-dd hh24:mi:ss')" + " and ";
}
if (type != "")
{
strsql += "type ='" + type + "' and ";
}
if (consumer != "")
{
strsql += &qu
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......
sql的软件在哪里可以下啊!在网上找了蛮多都用不了啊
随便搞一D版吧,
迅雷第一个就可以用
2000,2005都这样
http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......
tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......
我有一个类似的xml的 string,想通过遍历怎么个xml 输出我想要的element的值
xml 为:
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_XML_ME ......