Click here to Skip to main content
15,917,618 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: SQL server :Compressed string occupy more space than original string Pin
satc11-Aug-15 6:59
satc11-Aug-15 6:59 
AnswerRe: SQL server :Compressed string occupy more space than original string Pin
Richard Deeming11-Aug-15 7:29
mveRichard Deeming11-Aug-15 7:29 
GeneralRe: SQL server :Compressed string occupy more space than original string Pin
satc11-Aug-15 7:58
satc11-Aug-15 7:58 
GeneralRe: SQL server :Compressed string occupy more space than original string Pin
Richard Deeming11-Aug-15 8:17
mveRichard Deeming11-Aug-15 8:17 
GeneralRe: SQL server :Compressed string occupy more space than original string Pin
satc11-Aug-15 10:06
satc11-Aug-15 10:06 
GeneralRe: SQL server :Compressed string occupy more space than original string Pin
Richard Deeming11-Aug-15 10:37
mveRichard Deeming11-Aug-15 10:37 
GeneralRe: SQL server :Compressed string occupy more space than original string Pin
satc11-Aug-15 11:42
satc11-Aug-15 11:42 
GeneralRe: SQL server :Compressed string occupy more space than original string Pin
Richard Deeming13-Aug-15 1:35
mveRichard Deeming13-Aug-15 1:35 
QuestionUpdate data in Report View control on a form Pin
Member 1129477510-Aug-15 11:27
Member 1129477510-Aug-15 11:27 
AnswerRe: Update data in Report View control on a form Pin
Richard Deeming11-Aug-15 4:25
mveRichard Deeming11-Aug-15 4:25 
GeneralRe: Update data in Report View control on a form Pin
Member 1129477511-Aug-15 4:49
Member 1129477511-Aug-15 4:49 
QuestionEntity Framework : Get original Values for each object's property Pin
satc10-Aug-15 3:42
satc10-Aug-15 3:42 
AnswerRe: Entity Framework : Get original Values for each object's property Pin
Eddy Vluggen10-Aug-15 5:29
professionalEddy Vluggen10-Aug-15 5:29 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
satc10-Aug-15 5:47
satc10-Aug-15 5:47 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Eddy Vluggen10-Aug-15 5:53
professionalEddy Vluggen10-Aug-15 5:53 
AnswerRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 5:38
mveRichard Deeming10-Aug-15 5:38 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
satc10-Aug-15 5:47
satc10-Aug-15 5:47 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 5:54
mveRichard Deeming10-Aug-15 5:54 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Eddy Vluggen10-Aug-15 5:51
professionalEddy Vluggen10-Aug-15 5:51 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 5:56
mveRichard Deeming10-Aug-15 5:56 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
satc10-Aug-15 6:10
satc10-Aug-15 6:10 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 6:17
mveRichard Deeming10-Aug-15 6:17 
Questionvb coding Pin
Member 118868934-Aug-15 21:48
Member 118868934-Aug-15 21:48 
AnswerRe: vb coding Pin
Richard MacCutchan4-Aug-15 22:21
mveRichard MacCutchan4-Aug-15 22:21 
QuestionSQL Linq, Sum of multiple columns Pin
jkirkerx4-Aug-15 7:23
professionaljkirkerx4-Aug-15 7:23 
Well in plain TSQL it was pretty simple to calc the total amount of taxable items.
SQL
SELECT 
  SUM((qty * Price) - (qty * InstantSavings))
  FROM ShoppingCart
  WHERE SessionID = @SessionID 
  AND Taxable=1
I've gotten this far, pretty sure I'm on the right track here.
But I don't understand where "totals" come from in my statement. I mean yes I put it there because multiple examples used it, but the examples were just snippets.
I simply don't get it.
VB
Dim pValue As Decimal = 0
Using context As New DBContext()

   Dim totals as what?
   pValue = _
   (
      From sc In context.ShoppingCart
      Where sc.SessionID = p_sessionID _
      And sc.Taxable = True
      Group sc By sc.SessionID Into totals()
      Select
     {
       total = totals.Sum(Function(m) (m.Qty * m.Price) - (m.Qty * m.InstantSavings))
     }
   )

  End Using

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.