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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:07:58+00:00 2026-05-23T03:07:58+00:00

Alright, so what I’m attempting to do here, is select from a datatable all

  • 0

Alright, so what I’m attempting to do here, is select from a datatable all the rows that match two variables. First, I queried a SPList into a datatable. The datatable has two columns, Client ID, and Model Details. Here’s some of the code, so hopefully you can get an idea of what I’m attempting.

//These are contained within a foreach loop, so will be different through each
//iteration through.
int iClientID = gdbData.GetClientID(iJobNumberID);
string strModelDetails = xeApprovalUpdate.GetAttribute("ModelDetails");
string strClientID = iClientID.ToString()
//Here my datatable is populated from the sharepoint list I query
DataTable dtabModelDetails = queryModelDetails(splModelDetails);
DataRow[] drModelDetails = dtabModelDetails.Select(strClientID, strModelDetails);

Seeing as that didn’t work, I attempted to do the following select statement:

DataTable dtabModelDetails = queryModelDetails(splModelDetails);
string strDataExpression = "ClientID = " + strClientID + " AND Title = " + strModelDetails;
DataRow[] drModelDetails = dtabModelDetails.Select(strDataExpression);

Now I’m getting a syntax error for the select statement, but I’m pretty sure my syntax is correct? Would I get this error if my select statement returned no rows?

  • 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-23T03:07:59+00:00Added an answer on May 23, 2026 at 3:07 am

    Yes, you can add where clause to the DataTable Select method like this….

    DataRow[] drModelDetails = dtabModelDetails.Select("Client ID = '" + clientId + "' AND Model Details = '" + modelDetails + "'");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Alright there's two ways this can go. One is from the presentation side, and
Alright, here we go! I am currently developing an iPhone app that will work
Alright, so here's the portion of my code that is giving me a problem.
Alright, currently I have my SWF hitting a php file that will go and
Alright, I'm trying to read a comma delimited file and then put that into
Alright, I guess this question has been asked a lot of times here. I
Alright so here it goes, I have my user system working perfectly, and now
Alright, I am trying to accomplish this: When a user clicks a button that

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.