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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:44:36+00:00 2026-06-15T14:44:36+00:00

Alright now the question may come to you vague so I will try to

  • 0

Alright now the question may come to you vague so I will try to explain as much as possible.

For example I have 10 columns and 5000 rows in a data table called tblNpc.

So I will make a lot of filtering on this table during the work. I am using this approach here, but is that the best way of handling it?

Here a small example

    string srQuery = "select * from tblNpc";
    DataSet dsNPC = DbConnection.db_Select_Query(srQuery);

    DataView dvNPC = new DataView(dsNPC.Tables[0]);

    dvNPC.RowFilter = "npcId=32";
    string srExampleData = dvNPC[0]["npcName"].ToString();

C# 4.0, SQL Server 2008 R2

Important: I will use entire table and will do filtering equal to entire table row count

  • 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-15T14:44:37+00:00Added an answer on June 15, 2026 at 2:44 pm

    As per @Andormar's comments, it would be quicker if you hand over the filtering job to the SQL Server, which is designed to do the job, in the first place and bring over only what you needed.

    If you need to work with the DataTable in the code behind, then LINQ would be quicker I think. On top of that you could do complex queries with your DataTable with LINQ rather than RowFilter.

    For example your query can be done as

    var results = (from r in dsNPC.Tables[0].AsEnumerable()
                   where r.Field<int>("npcId")) ==32
                   select new { npcName = r.Field<string>("npcName")})
                  .FirstOrDefault();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright. Now this question may come to you weird but i have to solve
Alright let me explain my question with example We have a table that contains
Alright let me explain my question with example We have 1 table This table
Alright so i'll try to explain my problem clearly. I would like to have
Alright, I have a question, I veered away from using strings for selection so
Alright I have been looking for this for a while now, and didn't really
Alright, I have an embarrassingly simple question that hopefully has an embarrassingly simple answer.
Alright, I have some weird behavior and this question goes to the people out
Alright, I'm still a newbie in Perl, so the answer to this question may
Alright let me explain detailed my question this below image is displaying my matrix

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.