下面这条语句执行是正确的,可以得到结果:int n = Convert.ToInt16(Request.QueryString["id"]);
strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid where articleCate.cateid=" + n;
DataRow drw = dbf.GetDataRow(strqry); 现在我想按照ID降序排列,试了下面两种都不行,结果都是空的.大家帮忙看一下哪里错了:strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid where articleCate.cateid='" + n + "'order by id desc"; strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid where articleCate.cateid=" + n+"order by id desc";
strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid where articleCate.cateid=" + n;
DataRow drw = dbf.GetDataRow(strqry); 现在我想按照ID降序排列,试了下面两种都不行,结果都是空的.大家帮忙看一下哪里错了:strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid where articleCate.cateid='" + n + "'order by id desc"; strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid where articleCate.cateid=" + n+"order by id desc";
解决方案 »
- DropDownList绑定数组问题?
- WebBrowser在VS 2005 Web程序中数据提交不成功
- msxml2命名空间的调用问题
- 靶子哥 帮我看看JS得到DATAGRID的值的问题
- 关于COOKIE的问题,高手指点
- 谁能解决呀“服务器应用程序不可用”
- (急!!!)Asp.net应用程序的移植问题
- 如何將以下javascript語句改為vbscript語句?
- 请高手推荐几个专门学习asp.net的网站,谢!
- 网页中的操作被执行了两遍?这是为什么?
- 请问用AjaxControlToolkit如何调用WebService的WebMethod方法,然后根据返回值使用JAVASCRIPT来操作其他控件?
- 三层结构中怎样使用AspNetPager控件并结合分页存储过程使用
strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid order by id desc";
中国最大的 .NET 技术门户
http://www.entlib.net.cn
========
strqry = "select * from article inner join articleCate on article.parentid=articleCate.cateid where articleCate.cateid=" + n+" order by id desc";
后面n+"加个空格试试