Results 1 to 22 of 22

Thread: [2005] Graphics Card Clocks & Temperature

Hybrid View

  1. #1
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: [2005] Graphics Card Clocks & Temperature

    Yes, but you never have to, and I've found both the code and the Intellitype easier if you don't and just assign how you want your output to be arranged before you assign it to your variable:

    Code:
            Dim pumps As List(Of PumpStruct) = (From pump As PumpStruct In ordOrder.Pumps _
                                               Where pump.Status = 2 _
                                               Select pump Order By pump.PrintOrder Ascending).ToList
    
            Dim row As DataRow = (From r As DataRow In dt _
                                 Where r.Item("ORDER_NO").Equals(od.OrderNumber) _
                                 Select r).FirstOrDefault
    When I said I don't see the point, what I mean is "I don't see the point of assigning an anonymous type to a variable". In order to use it, you have to do something with it; either: ToList, ToArray, FirstOrDefault, etc...

    There may be some manipulations you can do with them though as anonymous types, perhaps with lambdas, but even the VB.NET structure for declaring lambdas is rigid:
    Code:
    Dim f As Func(Of Integer, Boolean) = Function(i As Integer) If(i > 5, True, False)
    I can't declare an anonymous type within a lambda function. So I dunno...
    Last edited by Jenner; Sep 2nd, 2008 at 11:13 AM.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width