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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:33:52+00:00 2026-05-20T17:33:52+00:00

NOTE: I am not an expert, so if you feel this question stupid/lame please

  • 0

NOTE: I am not an expert, so if you feel this question stupid/lame please forgive and mind your business. 🙂

Ok, as all video tutorials tell, create a LinqToSqlClasses item (dbml) file. drag tables and we are done here.

But in my case (or probably in all real world scenarios), we need more from our Data Access Layer than just the auto generated classes, right?

For Example: In a simple accounting software: i have a Accounts Table and a AccountingTransactions Table,

Now to get any account’s ledger we need to write a pretty Lengthy sql query, same goes for trial-balance, day book, and Single Vouchers et cetera.

What can we do in DAL to optimize these queries to have best performance.

  • 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-20T17:33:53+00:00Added an answer on May 20, 2026 at 5:33 pm

    I would recommend using Entity Framework over Linq to SQL.

    But in both these cases, you have the power of Linq for such queries. Plus this gives you better designer support (intellisense, strong types, compile time checking)

    EF or LinqToSQL becomes the lower level DAL and on top of this you would use the Repository pattern to call your Data Objects in a loosely coupled way. You could also add special methods for certain repositories to query data in a specific way if this needs to be encapsulated.

    You should search SO for the repository pattern with Entity Framework or LinqToSql, you’ll find a couple of implementations.

    See this answer :
    Advantage of creating a generic repository vs. specific repository for each object?

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

Sidebar

Related Questions

Note: Not sure if this is the right stack, please tell if I should
(Note: This is not a question about what is the best way with code
Note: There was not any question with this kind of problem here or anywhere...
Please note this code was not written by me. Otherwise I would not be
I'm not an expert on http request so this question might be trivial for
Before downvoting, please note that I am only asking for expert opinion, and not
Note: this is not real information: $ ssh-keygen -t rsa -C "tekkub@gmail.com" Generating public/private
Note: I'm not a newb, and I've done this a gazillion times, but for
Note: I am not exactly sure what to name the question, so if someone
First off: I am not an expert, so please excuse any mistakes I make

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.