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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:42:41+00:00 2026-05-22T12:42:41+00:00

I dont know if what i am asking is possible or not. That is

  • 0

I dont know if what i am asking is possible or not. That is why I am here to discuss .

I have a custom List that contains the information of all the users and their details.

On my application start I populate it from database. In other words it contains the copy of database. So instead of pulling data everytime from the database I want to perform operation on this list.

I wrote a query that searches users from database table and I want to translate it for this list so that my processing related to database is minimum. This is a single device application and no other user modifies the application.

List<Users> selectedUsers = new List<Users>();
sql_cmd = new SqlCommand();
sql_cmd.Connection = sql_con;
#region First Name Search
if (category == SearchCategory.ByFirstName)
{
    sql_cmd.Parameters.Add("@firstName", SqlDbType.VarChar).Value = Value;
    sql_cmd.CommandText = "SELECT * FROM AccountsUsers  WHERE accFirstName Like @firstName+'%'";
    SqlDataReader reader = sql_cmd.ExecuteReader();
    if (reader.HasRows == true)
    {
        while (reader.Read())
        {
            Users userToAdd = new Users();
            userToAdd.userId = int.Parse(reader["Id"].ToString());
            userToAdd.firstName = reader["accFirstName"].ToString();
            userToAdd.lastName = reader["accLastName"].ToString();
            //  GetAccountsDetails(userToAdd.userId, ref userToAdd);
            selectedUsers.Add(userToAdd);
        }
    }
}

What i indend to do is search list that i have made not the database for the users.for example List contains many users and if in search box i enter ASthen I can filter out all entries Starting with AS.
Want similar functionality that query wild card does.

  • 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-22T12:42:42+00:00Added an answer on May 22, 2026 at 12:42 pm

    Pretty vague question. What is exactly your question? It is ofcourse possible to do everything in the program and send data to the database only on demand or application exit. There are several ways to do this.

    The way you start is okay. You can alter users in any way you want and in the end you run throu them all again (or only those that have been change) and write a method to update them all to the database again.

    [Edit]

    Seeing your comment I assume you are talking about linq.

    With Linq (System.Linq) you can alter, order, skip or take.. and such on lists.

    When / where you want to apply ordering / sorting you can use stuff like

    selectedList.Where(m=>m.StartsWith("AS")); 
    selectedList.OrderBy(m=>m.firstname);
    

    It’s best not to set the selectedList to this since you want to keep using it.

    So to whatever datasource you set it. You can set it’s itemssource or datacontext to either of those above.

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

Sidebar

Related Questions

I don't know if what I'm asking is even possible, but here's my situation.
i dont know if i should be asking this here (im now thinking maybe
Please note that I'm not asking how but why. And I don't know if
I don't know if I am on right track or not still asking this
I dont know if this is possible. In SSIS Derived column transformation, can you
Prior to asking this question here, I have googled aroung. In general, people suggest
I have two arrays. $keys = array(1,2,3,6,9); //note that 9 does not exist as
I am asking this question here as I could not find any conclusive results
I'm asking here not because I never used visual studio but because I'm starting
I do not know if what I am asking is doable, stupid or simple.

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.