vb中数据库编程,在access里可以用,到sql server 里就提示不支持format函数
原句如下:
adodc1.ConnectionString = "provider=mircosoft.jet.oledb.4.0;persist security info=false;data source=f:\my.mdb;"
adodc1.RecordSource="select * from 表1 where format(生日,"yyyy")=2009"
......
"SELECT * from table1 WHERE (num IN (SELECT snum from table2 WHERE (column1 = '"+DropDownList1.SelectItem.Text+"'))) ORDER BY ID"
后台这样写能行,由于需要在前台写这条语句,怎么才能把DropDownList1的值传进去,还有就是,我前台通过
grade=<%=sgrade %>
可以显 ......
ASP连接的代码是这样的:
set conn=server.createobject("ADODB.connection")
SQL="Driver={SQL Server};Server=.;User Id=sa;Passward=wang_xiang;Initial Catalog=#@@0471loveSQL1.mdf"
conn.Open SQL
在浏览器下运行时出现了这样的错误:
HTTP 错误 500.100 - 内部服务器错误 - ASP 错误
错误 ......
*********
分数不够,只能发这儿了。
*********
一般我们使用这样的排序方式:
var DS = from a in DB.news where a.XXX == '1' orderby a.SSS,a.SSS2 descending select a;
如果动态排序的话,使用switch也可以满足需求,但当排序依据很多时,这显然不是明智之举。
我们可以这样做:
var DS = from a in DB.news wh ......
table1【表1】
t1_lsbh t1_flh
-------------------------------
xsfa123 001
xsfa123 002
sssssss 001
table2【表2】
t2_lsbh t1_flh
-------------------------------
xsfa123 001
希望结果:
t1_lsbh t ......
我用java写这么一个例子
数据库
numid ss
1 fasf
2 hsdh
3 asf
4 fasf
5 adasd
6 gsdg
7 hfdh
8 hfdh
9 fasf
10 saf
11 xia
...
我想用批处理查询出来
numid为1,3,4,5,6,7,8,10....
Java code:
ConnDB conn= new ConnDB();
PreparedStatement stmt = null;
......