Click here to Skip to main content
15,888,521 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Strange Behavior with Generics Pin
Urs Enzler1-May-08 10:12
Urs Enzler1-May-08 10:12 
QuestionUnsafe Assembly Permissions Pin
Brady Kelly30-Apr-08 5:15
Brady Kelly30-Apr-08 5:15 
QuestionDataTable.Select() Pin
alex.almeida30-Apr-08 3:24
alex.almeida30-Apr-08 3:24 
QuestionTableDataAdapter.Update to two mirror databases... [modified] Pin
sabr4930-Apr-08 2:07
sabr4930-Apr-08 2:07 
QuestionForce TextBox to show cursor Pin
Christian Wikander29-Apr-08 23:00
Christian Wikander29-Apr-08 23:00 
AnswerRe: Force TextBox to show cursor Pin
Arjun Marwaha30-Apr-08 7:44
Arjun Marwaha30-Apr-08 7:44 
QuestionSelect Statement Pin
Learning29-Apr-08 5:18
Learning29-Apr-08 5:18 
GeneralRe: Select Statement Pin
Mark J. Miller29-Apr-08 7:49
Mark J. Miller29-Apr-08 7:49 
You can't refer to columns by their alias until the ORDER BY clause because they haven't been serialized as the alias until then. So you have to define your two columns as:

SELECT (ItemCost * ItemQuantity) AS ItemSubtotal,
(ItemCost * ItemQuantity) - AmountPaid AS BalanceDue

If you're using SQL 2005, you could write a user defined function, call it subtotal and then use CROSS APPLY like this:

SELECT S.Subtotal AS ItemSubtotal,
S.Subtotal - ItemQuantity AS BalanceDue
FROM OrderDetails
CROSS APPLY dbo.GetSubTotal(ItemCost, ItemQuantity) S

But if your query isn't returning a large number of rows I really wouldn't worry about it and I would use the first method.


GeneralRe: Select Statement Pin
Learning30-Apr-08 4:42
Learning30-Apr-08 4:42 
Questionunable to find a version of the runtime to run this application Pin
Muhammad Gouda28-Apr-08 22:28
Muhammad Gouda28-Apr-08 22:28 
AnswerRe: unable to find a version of the runtime to run this application Pin
Zoltan Balazs29-Apr-08 6:54
Zoltan Balazs29-Apr-08 6:54 
AnswerRe: unable to find a version of the runtime to run this application Pin
Muhammad Gouda30-Apr-08 1:41
Muhammad Gouda30-Apr-08 1:41 
GeneralDatagrid Pin
sabr4928-Apr-08 15:02
sabr4928-Apr-08 15:02 
GeneralApplication running slow Pin
Bad Programmer28-Apr-08 11:12
Bad Programmer28-Apr-08 11:12 
GeneralCross Post. Please ignore. Pin
Pete O'Hanlon29-Apr-08 1:29
mvePete O'Hanlon29-Apr-08 1:29 
QuestionStymied by interop Pin
Mark Schumann28-Apr-08 9:27
Mark Schumann28-Apr-08 9:27 
AnswerRe: Stymied by interop Pin
led mike28-Apr-08 9:30
led mike28-Apr-08 9:30 
QuestionRe: Stymied by interop Pin
Mark Schumann1-May-08 8:56
Mark Schumann1-May-08 8:56 
GeneralMake a CAB file for PocketPc2003 Pin
AlexB4728-Apr-08 4:02
AlexB4728-Apr-08 4:02 
GeneralCross Post. Please ignore Pin
Pete O'Hanlon28-Apr-08 21:59
mvePete O'Hanlon28-Apr-08 21:59 
GeneralApplication.Run() Parameters Pin
saneng28-Apr-08 3:08
saneng28-Apr-08 3:08 
GeneralDouble Post Pin
Giorgi Dalakishvili28-Apr-08 3:50
mentorGiorgi Dalakishvili28-Apr-08 3:50 
QuestionHow to write this code using IFileOperation for Vista Pin
Mustanseer M S28-Apr-08 0:31
Mustanseer M S28-Apr-08 0:31 
AnswerRe: How to write this code using IFileOperation for Vista Pin
Mike Dimmick28-Apr-08 3:00
Mike Dimmick28-Apr-08 3:00 
GeneralRe: How to write this code using IFileOperation for Vista Pin
Mustanseer M S28-Apr-08 3:42
Mustanseer M S28-Apr-08 3:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.