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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:26:43+00:00 2026-05-15T23:26:43+00:00

I created a strongly-typed dataset in the dataset designer. The DataSet has a Table

  • 0

I created a strongly-typed dataset in the dataset designer. The DataSet has a Table called FocusOffsetsTable and that table has four colums; SerialNumber, Filter, Wheel and Offset. I use the ReadXml() method of the DataSet class to load the strongly typed data from the xml file into the dataset. That seems to be working just fine.

I am trying to use a LINQ expression to try to get a Single row from this table but I can’t seem to get the syntax correct. I want to use the Single() or SingleOrDefault() method to get just one row of data at a time but I am not sure how.

I have tried this FocusOffsets.FocusOffsetsTableRow x = FocusOffsetData.FocusOffsetsTable. but the Single() method is not available here. I also tried this…

 FocusOffsets.FocusOffsetsTableRow x = (from offset in FocusOffsetData.FocusOffsetsTable
                    where offset.SerialNumber == mydevice.SerialNumber
                    where offset.Wheel == WheelID
                    where offset.Filter == FilterNum
                    select offset).Single();

but the Single method is not available here either.

I have done this before with tables in a SQL database before but this is my first time using a dataset from the dataset designer.

  • 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-15T23:26:44+00:00Added an answer on May 15, 2026 at 11:26 pm

    Have you added a using statement for System.Linq and included a reference to System.Data.DataSetExtensions. I think (but can’t confirm since I’m on my Mac), that you ought to be able to do:

    var x = FocusOffsetData.FocusOffsetsTable
                           .AsEnumerable()
                           .SingleOrDefault( o => o.SerialNumber == mydevice.SerialNumber
                                                  && o.Wheel = WheelID
                                                  && o.Filter = FilterNum );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strongly typed DataTable created with the VS2005/VS2008 DataSet designer. The table
I have created a strongly typed dataset in the VS 2005 Dataset Designer. There
I am writing a site that uses strongly typed datasets. The DBA who created
I'm trying to add a strongly-typed view to the sample app that's created when
I've created a strongly typed dataset (MyDataSet) in my .NET app. For the sake
I've got a bunch of strongly typed DataSet that each have two tables. One
I have a strongly typed viewpage that I created that looks like this: <%@
I have a strongly typed view that is using a viewmodel I created. I
I created a strongly typed LocationViewData with a properties like public Location location {
Based on http://alexreg.wordpress.com/2009/05/03/strongly-typed-csv-reader-in-c/ , I created a DLL which can read different file types.

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.