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 I have all the information needed to phrase this question
I am asking this question here as I could not find any conclusive results
Prior to asking this question here, I have googled aroung. In general, people suggest
I don't know if this is possible using regex. I'm just asking in case
I dont know if I should use the httpcontext caching or the Enterprise Library
I dont know if I'm right, but allmost everytime I read about obfuscation and
Im new to programming and I dont know very much about but I'm making
I'm not sure if this is the right place to ask, but here goes...
I have build the simplest possible iPhone program, a window based program. I only
So, maybe this is a bad design; I don't know. But say I have

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.