string strSql="select id,sysdate,name,lianxi,wentilist,wenti,youxian,haoma,ipaddress,chuli from login where 1=1 ";
if(name1!="")
{
strSql+=" and name like '%"+name1+"%'";
}
if(this.Dp1.SelectedIndex>0)
{
strSql+=" and wentilist='"+name2+"'";
}
这样查出来的是按时间的顺序排列的,我想让它按时间倒序排列啊,请问应该怎么弄??
if(name1!="")
{
strSql+=" and name like '%"+name1+"%'";
}
if(this.Dp1.SelectedIndex>0)
{
strSql+=" and wentilist='"+name2+"'";
}
这样查出来的是按时间的顺序排列的,我想让它按时间倒序排列啊,请问应该怎么弄??
解决方案 »
- 在线求 FusionCharts 保存Flah例子,正确立马给分
- show.aspx页面怎样绑定数据,唯一标志一篇文章。
- 数据库中是乱码,可显示到页面上却是正常的?!!
- 熟悉 htmlselect 的进
- Intelligencia.UrlRewriter支持中文参数吗?
- 关于基于通知的数据缓存失效机制的问题
- 截取字符串中的中文
- 安装与部署的问题
- 路过的大哥,大姐:有没做过:如果客户端登陆的IP不是属于某个特定的IP,那么就算知道用户名和密码也不能登陆WEB系统,这个功能做过吗?
- Response.Write(5/30)的结果为什么是0,怎样才能输出小数?
- 如何让多个表的关系始终为一对一的关系?
- 如何插入非重复的数据?
完整应该是这样
string strSql="select id,sysdate,name,lianxi,wentilist,wenti,youxian,haoma,ipaddress,chuli from login where 1=1 ";
if(name1!="")
{
strSql+=" and name like '%"+name1+"%'";
}
if(this.Dp1.SelectedIndex>0)
{
strSql+=" and wentilist='"+name2+"'";
}
strSql+=" Order By sysdate desc"
完整应该是这样
string strSql="select id,sysdate,name,lianxi,wentilist,wenti,youxian,haoma,ipaddress,chuli from login where 1=1 ";
if(name1!="")
{
strSql+=" and name like '%"+name1+"%'";
}
if(this.Dp1.SelectedIndex>0)
{
strSql+=" and wentilist='"+name2+"'";
}
strSql+=" Order By sysdate desc"
我就是按这样弄的,结果为什么有时好,有时出现错误,在IE7上就没问题
完整应该是这样
string strSql="select id,sysdate,name,lianxi,wentilist,wenti,youxian,haoma,ipaddress,chuli from login where 1=1 ";
if(name1!="")
{
strSql+=" and name like '%"+name1+"%'";
}
if(this.Dp1.SelectedIndex>0)
{
strSql+=" and wentilist='"+name2+"'";
}
strSql+=" Order By sysdate desc"
我就是按这样弄的,结果为什么有时好,有时出现错误,在IE7上就没问题