Click here to Skip to main content
15,896,207 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Export Vb.net Datagridview to Microsoft Excel 2013 Pin
GuyThiebaut28-Aug-15 4:39
professionalGuyThiebaut28-Aug-15 4:39 
QuestionGood freeware barcode reader library Pin
vincentvdm22-Aug-15 22:04
vincentvdm22-Aug-15 22:04 
AnswerRe: Good freeware barcode reader library Pin
Eddy Vluggen24-Aug-15 5:27
professionalEddy Vluggen24-Aug-15 5:27 
QuestionAdd a DTPicker in a Column of grid in vb6.0 Pin
Anand_@ndy21-Aug-15 19:08
Anand_@ndy21-Aug-15 19:08 
AnswerRe: Add a DTPicker in a Column of grid in vb6.0 Pin
Eddy Vluggen24-Aug-15 5:26
professionalEddy Vluggen24-Aug-15 5:26 
QuestionHow To Set H-Scrolling And V-Scrolling With AspxpivoteGrid Devexpress Pin
Member 1174163219-Aug-15 22:30
Member 1174163219-Aug-15 22:30 
AnswerRe: How To Set H-Scrolling And V-Scrolling With AspxpivoteGrid Devexpress Pin
Eddy Vluggen24-Aug-15 5:23
professionalEddy Vluggen24-Aug-15 5:23 
QuestionVB, SQL Linq, 2 Joins and multiple Groups Pin
jkirkerx18-Aug-15 8:41
professionaljkirkerx18-Aug-15 8:41 
This is related to my post in the database forum from yesterday.
So I took the knowledge from my post below, and applied it to all my other stuff that required it and everything works fine. But I have a question.
I'm led to believe that you can do multiple Joins, but can only do 1 Group By

I have this sql linq statement, and it would be cool or efficient to just get it all in 1 call.
Right now, I just made another statement to get the vendor info.
I not even sure if it's possible to do.

Here's what I have right now.
I thought Group By pi.PartNumber, vi.VendorID Into productsSold would do the trick
perhaps it should be Group By { pi.PartNumber, vi.VendorID } Into productsSold

But then I understand the first Select product = productsSold, the group,
It seems you can only do it once, or you have to group all the Joins into it somehow. This is the part I'm fuzzy on.
Dim m_startDate As DateTime = New DateTime(2015, 1, 1, 0, 0, 0, 0)
Dim m_stopDate As DateTime = New DateTime(2015, 8, 31, 23, 59, 59, 999)
Dim p_PartNumber as string = "24-FLP44"
using context As New DBContext()

        Dim pResult = _
        (
            From cohc In context.Order_History_Cart
            Join pi In context.ProductInfo On cohc.PartNumber Equals pi.PartNumber
            Join vi In context.ProductInfo_Vendors On pi.VendorID Equals vi.VendorID
            Where cohc.PartNumber = p_PartNumber _
            And cohc.OrderDate >= m_startDate _
            And cohc.OrderDate <= m_stopDate _
            Order By cohc.PartNumber
            Group By pi.PartNumber Into productsSold = Group,
            totalQty = Sum(cohc.Qty),
            totalCost = Sum(cohc.Qty * cohc.Cost),
            totalPrice = Sum(cohc.Qty * cohc.Price)
            Select product = productsSold.Select(Function(m) m.pi).FirstOrDefault(), totalQty, totalCost, totalPrice
            Select 
                product.PartNumber,
                product.MPartNumber,
                product.Cost,
                product.Price,
                totalQty,
                totalCost,
                totalPrice,
                vendor.contactname,
                vendor.streetAddress1
                vendor.streetAddress2
        )   

        pResult.Dump()

end using

QuestionSql Linq, Adding a group Join or Join and performing Sums, I can't figure out the Join in VB Pin
jkirkerx17-Aug-15 13:45
professionaljkirkerx17-Aug-15 13:45 
AnswerRe: Sql Linq, Adding a group Join or Join and performing Sums, I can't figure out the Join in VB Pin
Richard Deeming18-Aug-15 1:07
mveRichard Deeming18-Aug-15 1:07 
GeneralRe: Sql Linq, Adding a group Join or Join and performing Sums, I can't figure out the Join in VB Pin
jkirkerx18-Aug-15 6:37
professionaljkirkerx18-Aug-15 6:37 
QuestionExcel VBA read application CPU Usage Pin
Member 1191534517-Aug-15 8:24
Member 1191534517-Aug-15 8:24 
AnswerRe: Excel VBA read application CPU Usage Pin
Wendelius17-Aug-15 8:33
mentorWendelius17-Aug-15 8:33 
GeneralRe: Excel VBA read application CPU Usage Pin
Member 1191534517-Aug-15 9:14
Member 1191534517-Aug-15 9:14 
GeneralRe: Excel VBA read application CPU Usage Pin
Mycroft Holmes17-Aug-15 13:03
professionalMycroft Holmes17-Aug-15 13:03 
RantRe: Excel VBA read application CPU Usage Pin
Richard Deeming18-Aug-15 0:24
mveRichard Deeming18-Aug-15 0:24 
GeneralRe: Excel VBA read application CPU Usage Pin
Wendelius18-Aug-15 9:20
mentorWendelius18-Aug-15 9:20 
QuestionMenuItem question Pin
econy17-Aug-15 4:36
econy17-Aug-15 4:36 
GeneralRe: MenuItem question Pin
Ralf Meier17-Aug-15 18:21
mveRalf Meier17-Aug-15 18:21 
GeneralRe: MenuItem question Pin
econy18-Aug-15 2:20
econy18-Aug-15 2:20 
GeneralRe: MenuItem question Pin
Ralf Meier18-Aug-15 5:06
mveRalf Meier18-Aug-15 5:06 
QuestionStoring Files inside SQL server database : Good or BAD idea ? Pin
satc15-Aug-15 5:25
satc15-Aug-15 5:25 
GeneralRe: Storing Files inside SQL server database : Good or BAD idea ? Pin
PIEBALDconsult15-Aug-15 5:41
mvePIEBALDconsult15-Aug-15 5:41 
GeneralRe: Storing Files inside SQL server database : Good or BAD idea ? Pin
satc15-Aug-15 6:36
satc15-Aug-15 6:36 
GeneralRe: Storing Files inside SQL server database : Good or BAD idea ? Pin
PIEBALDconsult15-Aug-15 7:25
mvePIEBALDconsult15-Aug-15 7:25 

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.