Click here to Skip to main content
15,899,679 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Why this query produce wrong results ? Pin
dilkonika21-Feb-15 8:05
dilkonika21-Feb-15 8:05 
GeneralRe: Why this query produce wrong results ? Pin
Dave Kreskowiak21-Feb-15 12:59
mveDave Kreskowiak21-Feb-15 12:59 
GeneralRe: Why this query produce wrong results ? Pin
dilkonika21-Feb-15 14:32
dilkonika21-Feb-15 14:32 
GeneralRe: Why this query produce wrong results ? Pin
Dave Kreskowiak21-Feb-15 15:38
mveDave Kreskowiak21-Feb-15 15:38 
GeneralRe: Why this query produce wrong results ? Pin
dilkonika21-Feb-15 16:00
dilkonika21-Feb-15 16:00 
GeneralRe: Why this query produce wrong results ? Pin
Dave Kreskowiak21-Feb-15 16:44
mveDave Kreskowiak21-Feb-15 16:44 
GeneralRe: Why this query produce wrong results ? Pin
dilkonika21-Feb-15 16:52
dilkonika21-Feb-15 16:52 
GeneralRe: Why this query produce wrong results ? Pin
dilkonika21-Feb-15 17:28
dilkonika21-Feb-15 17:28 
Hello !
This is my last question :

I don't know why , but this is working :

Partial Public Class Myobj
      Public Property id As Integer
      Public property name as string
      Public Overridable Property chld As ICollection(Of chld) = New HashSet(Of chld) 
   End Class
 

 Partial Public Class Myobj
      <NotMapped> Public Property vls As integer
End Class
 
Partial Public Class chld
    Public Property id As Integer
    Public Property date1 as DateTime
    Public Property quantity as Integer
    Public Property ParentID as integer
    Public Overridable Property MyObj1 As MyObj
End Class 

Public Class PseudoMyObj
    Inherits MyObj
End Class
 
 
Now on my form, I have this code :
  

Dim dt1 as DateTime=CDate("08/08/2014")

 
 Dim list1 = (From t In context.MyObj Select New With { _
      .Parent = New PseudoMyObj With {  _
      .chld =  (From t2 in t.chld.AsQueryable.Where(Function(t3) t3.Date1>=dt1) Select t2), _
      .vls=(t.chld.AsQueryable.Where(Function(t2) t2.date1<dt1).Select(Function(t3) t3.quantity).DefaultIfEmpty.Sum()) _
}).ToList

dim mylist as IEnumerable(of MyObj)=list1.Select(Function(t2) t2.Parent)


Please , I want your opinion , do you see anything wrong with this code ?
Thank you !
GeneralRe: Why this query produce wrong results ? Pin
Dave Kreskowiak22-Feb-15 3:36
mveDave Kreskowiak22-Feb-15 3:36 
QuestionHow do I display different group boxes, according to radio button selected ? Pin
Member 1144766219-Feb-15 7:30
Member 1144766219-Feb-15 7:30 
AnswerRe: How do I display different group boxes, according to radio button selected ? Pin
Wendelius19-Feb-15 7:40
mentorWendelius19-Feb-15 7:40 
GeneralRe: How do I display different group boxes, according to radio button selected ? Pin
Member 1144766219-Feb-15 7:41
Member 1144766219-Feb-15 7:41 
GeneralRe: How do I display different group boxes, according to radio button selected ? Pin
Wendelius19-Feb-15 7:56
mentorWendelius19-Feb-15 7:56 
QuestionVB dropdown list that will enable another after a selection is made with a private sub Pin
Bluewolf3119-Feb-15 2:34
Bluewolf3119-Feb-15 2:34 
AnswerRe: VB dropdown list that will enable another after a selection is made with a private sub Pin
Eddy Vluggen19-Feb-15 5:57
professionalEddy Vluggen19-Feb-15 5:57 
GeneralRe: VB dropdown list that will enable another after a selection is made with a private sub Pin
Bluewolf3119-Feb-15 7:56
Bluewolf3119-Feb-15 7:56 
GeneralRe: VB dropdown list that will enable another after a selection is made with a private sub Pin
Bluewolf3119-Feb-15 8:20
Bluewolf3119-Feb-15 8:20 
GeneralRe: VB dropdown list that will enable another after a selection is made with a private sub Pin
Eddy Vluggen19-Feb-15 8:39
professionalEddy Vluggen19-Feb-15 8:39 
QuestionData entry in sequential file in vb6 Pin
Preeti197918-Feb-15 22:28
Preeti197918-Feb-15 22:28 
AnswerRe: Data entry in sequential file in vb6 Pin
den2k8818-Feb-15 22:35
professionalden2k8818-Feb-15 22:35 
GeneralRe: Data entry in sequential file in vb6 Pin
Preeti197919-Feb-15 1:06
Preeti197919-Feb-15 1:06 
QuestionIs possible to use a global variable inside a class ? Pin
dilkonika18-Feb-15 11:11
dilkonika18-Feb-15 11:11 
AnswerRe: Is possible to use a global variable inside a class ? Pin
Duncan Edwards Jones18-Feb-15 11:19
professionalDuncan Edwards Jones18-Feb-15 11:19 
QuestionHow to show time zones in dates (Time Stamp) Pin
Murray Whipps18-Feb-15 7:13
Murray Whipps18-Feb-15 7:13 
AnswerRe: How to show time zones in dates (Time Stamp) Pin
Richard Andrew x6418-Feb-15 8:37
professionalRichard Andrew x6418-Feb-15 8:37 

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.