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

  • Home
  • SEARCH
  • 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 8200171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:20:53+00:00 2026-06-07T06:20:53+00:00

I have a database in my windows phone app. From a Table I need

  • 0

I have a database in my windows phone app. From a Table I need to select some rows. I need to apply more than one Where conditions in my query. How can I write such a query?

My table contains Username, DocumentId, FileType, FileLocation, FileSize etc..

I need to select rows using Username, DocumentId and FileType. How to write the query for that?

Now I am using the following code :

using (DocumentDataContext DocDb = new DocumentDataContext(strConnectionString))
{
    IQueryable<Document> DocQuery = from Doc in DocDb.Documents where Doc.UserName == txtName.Text select Doc;
    Document Docs= DocQuery.FirstOrDefault();
}

I can select one document using this query. I want to select all rows satisfy the conditions. Can I do this in a single query?

  • 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-07T06:20:55+00:00Added an answer on June 7, 2026 at 6:20 am

    Of course you can. You can extend your where condition using standard or/and keywords:

    from Doc in DocDb.Documents
    where Doc.UserName == txtName.Text && dic.FileType == "some type" && Doc.UserName == "some name"
    select Doc;
    

    To get more than one row use ToList instead of FirstOrDefault. It returns a list of elements containing the query results:

    var Docs= DocQuery.ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large database table that I need to display on a Windows
In my windows phone 7 app i have database-class generated by sqlmetal. in addition,
I have an embedded database in windows forms app. Is it possible to browse
Currently I have Windows App which is directly opening database connection (SQL Server is
I have created a Windows Service in VB.net for building xML from a database.
I have a web application running on Windows IIS. This app has a database
I have a background agent and a foreground app on Windows Phone Mango. (These
I want to visualize some data in my Windows Phone app. So I'm using
NTEXT with more than 4000 characters in SQL Server CE in windows phone I
i have a windows phone application and am trying to connect to a database.

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.