Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7445097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:44:18+00:00 2026-05-29T11:44:18+00:00

I have been working on trying to leverage data contained in an Access Database

  • 0

I have been working on trying to leverage data contained in an Access Database for the last few weeks. I got to the point where I feel I should think how I will implement the design.

If I am not mistake one cannot use an Anonymous Type as a paramter to a method. This leaves me wondering what the best to return the result of a LINQ query within a method is. If you need some background information all the questions are from the last two weeks.

So this leaves me wondering someting:

Do I have to use the the var syntax when writting my query? Based on the article I read here Here I could in theory use my own class or in the examples listed on the page ( string, int, ect ).

This leads to me to the second part of my question:
If I were to say use the following syntax

IEnumerable<CustomClassHere> result = (from X in ....
where ....
**select** new CustomClassHere
{
Value = X.Field<int>("...")
}
);

Would I have able to return the result within a method that returns a IEnumerable?

I am willing to provide additional details, provide a more detailed code sample, if my current question is not clear. If you have any design suggestions that involve LINQ I would appreciate hearing them. I am looking to make this class and its interaction with the Access Database as modular as possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:44:19+00:00Added an answer on May 29, 2026 at 11:44 am

    Sample Class

    public class abc
    {
        internal string str;
        internal int i;
    }
    

    List Collection

    List<abc> List = new List<abc>();
    
    abc Obj = new abc();
    Obj.str = "1";
    Obj.i = 1;
    List.Add(Obj);
    
    Obj = new abc();
    Obj.str = "2";
    Obj.i = 1;
    List.Add(Obj);
    
    Obj = new abc();
    Obj.str = "3";
    Obj.i = 1;
    List.Add(Obj);
    

    IEnumerable<abc> FinalList = (from lst in List select lst).ToList();
    

    ResultSet

    enter image description here


    Sample Reference

    101 LINQ SAMPLES – Very helpful to make stronghold on LINQ to Objects

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write to a data base, I have been working of the
I have been working on a scheduling website for the past few weeks. I
I have been working with Mahout in the past few days trying to create
Recently I have been working with a SQL Server database and I was trying
I have been working on a fancy router/dispatcher class for weeks now trying to
I'm new to C# and have been working on learning database's. Currently I'm trying
So I have been working and trying for a couple of hours. I am
I have been working on this problem for a while now. I am trying
I have been working on this for 24 hours now, trying to optimize it.
I have been trying for 4 days to get app-engine and grails working together

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.