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 742523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:45:28+00:00 2026-05-14T08:45:28+00:00

I asked on SO a few days ago what was the simplest quickest way

  • 0

I asked on SO a few days ago what was the simplest quickest way to build a wrapper around a recently completed database. I took the advice and used sqlmetal to build linq classes around my database design.

Now I am having two problems. One, I don’t know LINQ. And, two, I have been shocked to realize how hard it is to learn. I have a book on LINQ (Linq In Action by Manning) and it has helped some but at the end of the day it is going to take me a couple of weeks to get traction and I need to make some progress on my project today.

So, I am looking for some help getting started.

Click HERE To see my simple database schema.
Click HERE to see the vb class that was generated for the schema.

My needs are simple. I have a console app. The main table is the SupplyModel table. Most of the other tables are child tables of the SupplyModel table.

I want to iterate through each of Supply Model records. I want to grab the data for a supply model and then DoStuff with the data. And I also need to iterate through the child records, for each supply model, for example the NumberedInventories and DoStuff with that as well.

I need help doing this in VB rather than C# if possible. I am not looking for the whole solution…if you can supply a couple of code-snippets to get me on my way that would be great.

Thanks for your help.

EDIT
For the record I have already written the following code…

Dim _dataContext As DataContext = New DataContext(ConnectionStrings("SupplyModelDB").ConnectionString)
Dim SMs As Table(Of Data.SupplyModels) = _dataContext.GetTable(Of Data.SupplyModels)()
Dim query = From sm In SMs Where sm.SupplyModelID = 1 Select sm

This code is working…I have a query object and I can use ObjectDumper to enumerate and dump the data…but I still can’t figure it out…because ObjectDumper uses reflection and other language constructs I don’t get. It DOES enumerate both the parent and child data just like I want (when level=2).

PLEASE HELP…I’M stuck. Help!

Seth

  • 1 1 Answer
  • 1 View
  • 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-14T08:45:28+00:00Added an answer on May 14, 2026 at 8:45 am

    in C# it would be:

        var result = from s in _dataContent.SupplyModels where s.SupplyModelID==1 select s;
        foreach(SupplyModel item in result)
        {
           // do stuff
           foreach(SupplyModelChild child in item.SupplyModelChilds)
           {
              //do more stuff on the child
           }
        }
    

    and a VB.NET version (from the Telerik code converter)

    Dim result As var = From s In _dataContent.SupplyModels _
        Where s.SupplyModelID = 1 _
        Select s
    For Each item As SupplyModel In result
        ' do stuff
                'do more stuff on the child
        For Each child As SupplyModelChild In item.SupplyModelChilds
        Next
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

few days ago, my freind asked me to build him a proagram that start
A few days ago I asked this question about jquery ajax function invoking action
few days ago i asked about how to get all running processes in the
I asked a question a few days ago about how to customise the calendar
Guys I've asked few days ago a question and didn't have really time to
so I asked here few days ago about C# and its principles. Now, if
A few days ago I asked a question that might be a little unclear.
A few days ago I asked about passing a data structure from java to
A few days ago I asked here about how to add src attribute to
few days ago I asked here about implementing USB. Now, If I may, would

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.