Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Anonymous Type. How to solve this?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 06 Mar 2008 14:41 GMT
Hello,

I am getting a anonymous type from Linq Query inside a function.
How can I return the obtained values and use them outside the
function?

Do I need to create a new class?

Here is my code:

   Public Shared Function GetStats() As ??????????????????

     Dim database As New CodeDataContext
     Dim statistics = database.Tags.Select( _
     Function(t) New With { _
       Key .Total = database.Tags.Count(), _
       Key .Linked = database.Tags.Where( _
         Function(tag) _
           tag.FilesTags.Any() OrElse _
           tag.ArticlesTags.Any()).Count() _
     }).FirstOrDefault()

     Return statistics ???????????????????

   End Function

Thanks,
Miguel
Alexey Smirnov - 06 Mar 2008 19:38 GMT
>  Hello,
>
[quoted text clipped - 24 lines]
> Thanks,
> Miguel

Maybe you can use an Object data type?
shapper - 06 Mar 2008 20:32 GMT
> >  Hello,
>
[quoted text clipped - 26 lines]
>
> Maybe you can use an Object data type?

Yes, but the type properties are not recognized by my editor outside
the function ...

... maybe I will create a class and return that class.

Thanks,
Miguel

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.