-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I got a stored procedure that delivers a table of students, and it needs to order by surname, name etc... it also needs to sort ascending, descending, depending on the parameter @orderby...
code:
ORDER BY
CASE
WHEN @orderby = 'studentkey' THEN Studentkey END ASC,
CASE
WHEN @orderby = 'studentkey'…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
var result = db.PhotoAlbums.Select(albums => new PhotoAlbumDisplay
{
AlbumID = albums.AlbumID,
Title = albums.Title,
Date = albums.Date,
PhotoID = albums.Photos.Select(photo => photo.PhotoID).FirstOrDefault().ToString()
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm using the following query syntax
from table
where
where
orderby
orderby
Where the first orderby is a date and second orderby is a date. I would assume this would work like orderby thenby but appears to be doing something else.
1 How can I do an orderby thenby using the above syntax without…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
HI, i want to do this:
orderby = "Nome, Cognome desc";
var timb = time.Timbratures.Include("Anagrafica_Dipendente").Where(p => p.CodDipendente == 1);
if(orderBy != "")
timb = timb.OrderBy(orderBy);
Is there any method for pass a string parameter to Orderby
thanks
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have the following SQL within a stored procedure. Is there a way to remove the IF statement and pass the 'ASC'/'DESC' option as a variable?
I know I could do the query a number of different ways, or return a table and sort it externally etc. I would just like to know if I can avoid duplicating…
>>> More