Solved

using linq to return single value

Posted on 2009-07-16
1
1,341 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

15 Experts available now in Live!

Get 1:1 Help Now