Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 07, 2012 08:46 PM by rajsedhain
Participant
1153 Points
438 Posts
Mar 04, 2012 09:00 AM|LINK
Hello,
Does anyone know how I can combine ---> strSelect = "Select AlbumNotesHtml From Products Where uid=@uid"
Plus add ORDER BY uid DESC
So that it's Something like this---> strSelect = "Select AlbumNotesHtml From Products Where uid=@uid AND ORDER BY DESC"
When I run this ---> strSelect = "Select AlbumNotesHtml From Products Where uid=@uid AND ORDER BY DESC"
I get a Not Correct Syntax Error Message:
All-Star
18223 Points
2725 Posts
Mar 04, 2012 09:40 AM|LINK
USe the following:
select uid, AlbumNotesHtml From Products Where uid=@uid ORDER BY uid DESC
---Edited---------
Or simply:
select AlbumNotesHtml From Products Where uid=@uid ORDER BY uid DESC
Contributor
4181 Points
1041 Posts
Mar 07, 2012 08:46 PM|LINK
you have to specify the ORDER BY keyword: is used to sort the result-set by a specified column.
so, you can orderby AlbumNotesHtml or by uid:
Select AlbumNotesHtml From Products Where uid=@uid AND ORDER BY AlbumNotesHtml DESC
more:
http://www.w3schools.com/sql/sql_orderby.asp
asp.netcat
Participant
1153 Points
438 Posts
Combine Help
Mar 04, 2012 09:00 AM|LINK
Hello,
Does anyone know how I can combine ---> strSelect = "Select AlbumNotesHtml From Products Where uid=@uid"
Plus add ORDER BY uid DESC
So that it's Something like this---> strSelect = "Select AlbumNotesHtml From Products Where uid=@uid AND ORDER BY DESC"
When I run this ---> strSelect = "Select AlbumNotesHtml From Products Where uid=@uid AND ORDER BY DESC"
I get a Not Correct Syntax Error Message:
adeelehsan
All-Star
18223 Points
2725 Posts
Re: Combine Help
Mar 04, 2012 09:40 AM|LINK
USe the following:
---Edited---------
Or simply:
MCPD ASP.NET 4.0 and 3.5, MCTS WSS, MOSS, SharePoint 2010, MCT
Microsoft Community Contributor Award 2011
rajsedhain
Contributor
4181 Points
1041 Posts
Re: Combine Help
Mar 07, 2012 08:46 PM|LINK
you have to specify the ORDER BY keyword: is used to sort the result-set by a specified column.
so, you can orderby AlbumNotesHtml or by uid:
more:
http://www.w3schools.com/sql/sql_orderby.asp
Raj Sedhain