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

  • SEARCH
  • Home
  • 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 539805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:10:30+00:00 2026-05-13T10:10:30+00:00

Im having a really hard time figuring out how to specify a good search

  • 0

Im having a really hard time figuring out how to specify a good search term for my problem: separation of gui and database interaction in visual studio 2008 using Linq to sql.

According to my teacher in a c# class im taking it’s not correct to let the GUI be dependant on a specific way of getting data.

The way my project is currently set up is that we have a mssql database where everything is stored.
The solution is split into 4 seperate projects. UserGUI, AdminGUI, Logic and Db.

Now using linq to populate listboxes and similar things I use something like:

From the windows form in the project UserGUI:

//The activeReservationBindingSource has Db.ActiveReservation as it's value
private void refreshReservation() {
            activeReservationBindingSource.DataSource = logic.getActiveReservationsQry();
        }

To the Logic project:

public IQueryable getActiveReservationsQry() {
    return dbOperations.getActiveReservationsQry(this.currentMemberId);
}

To the database project:

public IQueryable getActiveReservationsQry(int memberId) {
            var qry =
             from active in db.ActiveReservations
             where active.memberId == memberId
             orderby active.reservationId
             select active;

            return qry;
        }

This makes sense to me seing as I can send items from listboxes all the way to the database project and there easily update/insert things into the mssql database. The problem is that it would be pretty hard to merge over from a mssql database to lets say an access version.

What should I be reading up on to understand how to do this correctly? Is creating my own classes with the same values as the ones visual studio generates for me when I create the dbml file a way to go? Should I then in the logic project populate for example List that I pass to the GUI? To me it seams like “double work” but perhaps it’s the correct way to go?

Be adviced that we have not read anything about design patterns or business logic which seems to be a pretty big subject which im looking forward to exploring outside the frame of the course at a later time.

I was also thinking that IQueryable inherits from IEnumerable and perhaps that was the way to go but I have failed to find any information that made sense to me on how to actually accomplish this.

The GUI also knows about the datasources which I think is a bad thing but can’t figure out how to get rid of.

Please understand that I tried to figure this out with my teacher for half an hour today at the only tutoring available for this project and then spent most of the day trying to find similar answers on google, SO and from classmates without any result.

  • 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-13T10:10:30+00:00Added an answer on May 13, 2026 at 10:10 am

    One keyword to read up on: Model-View-Controller. That’s kind of the idea you’re after. Your “View” is the GUI. The “Model” is the data layer, and the Controller is the code that takes data from the DB and hands it to the GUI (and vice-versa.)

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

Sidebar

Ask A Question

Stats

  • Questions 291k
  • Answers 291k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's quite possible to do this, but before you even… May 13, 2026 at 6:05 pm
  • Editorial Team
    Editorial Team added an answer I hacked an old version of jquery around a bit,… May 13, 2026 at 6:05 pm
  • Editorial Team
    Editorial Team added an answer I presume you mean <input type="password"> If so, you can… May 13, 2026 at 6:05 pm

Related Questions

I think I understand the basic principals of T4 but I'm having a hard
I'm trying to figure out how to add some directshow capabilities to a C#
I made a movieclip symbol called SwordHolder then went through ALL my animations and
I'm a beginner in WPF and currently working on my first app. For this
I've recently switched from being an employee of a small consulting company to being

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.