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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:52:14+00:00 2026-06-12T13:52:14+00:00

I have a sharepoint 2007 list in which there is a column ‘EmpID’ which

  • 0

I have a sharepoint 2007 list in which there is a column ‘EmpID’ which contains employee ids in this format: 12345;6789;121212

I need to find if 12345 is present in EmpID column. If i use caml query using asp.net It does not give me any result for only “12345”.

If i enter whole data “12345;6789;121212” then only it gives me result. Please Help. I nees to search only 12345

using (SPSite site = new SPSite("URL"))
            {
                using (SPWeb web = site.OpenWeb())
                {

                        SPList List = web.Lists["List Name"];
                        SPQuery query = new SPQuery();

                                       query.Query = "<Where><Eq><FieldRef Name='EMP_x0020_ID' /><Value Type='Text'>" + TextBox1.Text + "</Value></Eq></Where><OrderBy><FieldRef Name='Title'/></OrderBy>";

                        SPListItemCollection items = List.GetItems(query);

                        DataTable dt = items.GetDataTable();

                        if (dt==null)
                        {
                            Label1.Text = "No data";
                        }
                        else
                        {
                            foreach (DataRow r in dt.Rows)
                            {
                                Label1.Text += r["Title"];
                            }

                        }
                }

}

  • 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-12T13:52:15+00:00Added an answer on June 12, 2026 at 1:52 pm

    it was so easy… use contains instead of EQ

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

Sidebar

Related Questions

I have a Task list in Sharepoint 2007 SP2. For this list I made
I'm using sharepoint 2007. I have a list called User Tickets with one column
( Regarding Moss 2007 ) i have created a sharepoint list in which one
I have a custom list in SharePoint (specifically, MOSS 2007.) One field is a
We are using Sharepoint 2007 In which on master page we have Asp Image
In SharePoint 2003 and 2007, there was a table called AllLists which had a
We have a SharePoint 2007 deployment which will have a substantially large document library.
Hi I have two Lists in sharepoint 2007. I have a lookup column in
I am using microsoft office sharepoint server 2007. i have a sharepoint list in
I have a Silverlight control in MOSS (Sharepoint 2007) which I want to conditionally

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.