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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:24:15+00:00 2026-06-14T12:24:15+00:00

I am sorry that they ask this question has been asked many times but

  • 0

I am sorry that they ask this question has been asked many times but I still have not yet found the best answer.

I am worried applications take a long time to download the record or filter the records. Assuming I have a table called tbl_customer. And records in tbl_customer more than 10,000 rows.

The first question, I am using Data Grid View to display the records. Would be ideal if I download all the records up to 10,000 rows into the Data Grid View? Or perhaps I had better put the record row limit?

Second question, what is the best way to filter records in tbl_customer. Do we just need to query using SQL? or using LINQ? or maybe there is a better way?

For now, I only use this way:

DataTable dtCustomer = new DataTable();

 using (SqlConnection conn = new SqlConnection(cs.connString))
        {
            string query = "SELECT customerName,customerAddress FROM tbl_customer WHERE customerAddress = '"+addressValue+"' ORDER BY customerName ASC;";

            using (SqlDataAdapter adap = new SqlDataAdapter(query, conn))
            {
                adap.Fill(dtCustomer);

            }
        }

dgvListCustomer.DataSource = dtCustomer

Then I learn about LINQ so i do like this

    DataTable dtCustomer = new DataTable();

         using (SqlConnection conn = new SqlConnection(cs.connString))
                {
                    string query = "SELECT * FROM tbl_customer ORDER BY customerName ASC;";

                    using (SqlDataAdapter adap = new SqlDataAdapter(query, conn))
                    {
                        adap.Fill(dtCustomer);

                    }
                }

var resultCustomer = from row in dtCustomer.AsEnumerable()
                                         where row.Field<string>("customerAddress") == addressValue
                                         select new
                                         {
                                             customerName = row["customerName"].ToString(),
                                             customerAddress = row2["customerAddress"].ToString(),

                                         };

 dgvListCustomer.DataSource = resultCustomer;

Workflow SQL> DATATABLE> LINQ > DataGridView is suitable to filter records? Or if there are better suggestions are most welcome.

Thanks you..:)

  • 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-06-14T12:24:16+00:00Added an answer on June 14, 2026 at 12:24 pm

    I am worried applications take a long time to download the record or filter the records.

    Welcome – you seem to live in a world like me where performance ms measured in milliseconds, and yes, on a low power server it will take likely more than a millisecond (0.001 seconds) to hot load and filter 10.000 rows.

    As such, my advice is not to put that database on a tablet or mobile phone but to use at least a decent desktop level compute r or VM for the database server.

    As a hint: I am regularly making queries on a billion row table and it is fast. Anything below a million rows is a joke these days – in fact it was nothing worth mentioning when I started with databases more than 15 years ago. You are the guy asking whether it is better to have a ferrari or a porsche becauese you are concerned whether any of those case goes more than 20km/h.

    Would be ideal if I download all the records up to 10,000 rows into the Data Grid View?

    In order to get fired? Yes. Old rule with databases: never load more data than you have to, especially when you have no clue. Forget the SQL side – you will get UI problems with 10.000 rows and more, especially usability issues.

    Do we just need to query using SQL? or using LINQ?

    Hint: Linq is also using SQL under the hood. The question is more – how much time do you want to spend writing boring repetitive code for handwritten SQL like in your examples? Espeically given that you also do “smart” things like referencing fields by name, not ordinal, and asking for “select *” instead of a field list, bot obvious beginner mistakes.

    What you should definitely not do – but you do – is using a DataTable. Get a decent book about programming databases. RTFSM may help – both LINQ (which I am not sure what you mean – LINQ is a language for the compiler, you need an implementor, so that could be NHibernate, Entity Framework, Linq2Sql, BlToolkit, to name just a FEW tha t go from a LINQ query to a sql statement).

    Workflow SQL> DATATABLE> LINQ > DataGridView is suitable to filter records?

    A Ferrari is also suitable to transport 20 tons of coal from A to B – just the worst possible car for it. GSour stack is likely the worst I have seen, but it is suuitable in that you CAN do it – slow, lots f mmemoory use, but you will get a result and hopefully fired. You pull the data from a high performance database into a data table, then use a non integrating technology (LINQ) to filter (not using the indices in the data table) to go into yet another layer.

    Just to give you an idea – this would get you removed from quite some “beginning programming” courses.

    What about:

    LINQ

    Point.

    Pulls a collection of business objects that go to the UI. Period.

    Read at least some of the sample code for the technologies you use.

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

Sidebar

Related Questions

I'm really sorry if this question has nothing to do on this site, but
I ask this question expecting the answer to be 'not possible', as I have
Sorry that I haven't done much of my own research but I do not
Sorry that I can't find the answer through google - But I know this
first of all, sorry if that question is dumb but I´m a total newbie
This question will be a little longer and I am sorry for that :)
Sorry if the title is not that specific, but I don't know how else
Sorry about the vague title, but i didnt know how to ask the question
I have the following situation: There is a windows folder that has been mounted
Sorry if this sounds like a bit of a noobie question, i'm still relatively

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.