Solved

using linq to return single value

Posted on 2009-07-16
1
1,342 Views
Last Modified: 2013-11-11
I have a table that is an hourly rate and only contains one value that is of type integer.

I need a linq helper method just to return this single value
0
Comment
Question by:mugsey
1 Comment
 
LVL 12

Accepted Solution

by:
GuitarRich earned 500 total points
ID: 24867786
try this - if you need to add filters in, just add a where clause before the select line.
int returnValue = (from t in Context.YourTable

                   select t.HourlyRate).SingleOrDefault();

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SSRS ReportViewer report timeout 7 104
Error in script 11 47
SQL Exceptions 3 39
how can i get the executable application's path in a specific form? ('\\' instead of '\ ') 5 30
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now