Click here to Skip to main content
       

LINQ

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
QuestionHOW TO ANSWER A QUESTIONadminChris Maunder16 Jul '09 - 3:09 
Apologies for the shouting but this is important.
 
When answering a question please:
  1. Read the question carefully
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
  3. If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
  4. If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
 
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

QuestionHow to get an answer to your questionadminChris Maunder16 Jul '09 - 3:05 
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
     
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
     
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
     
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
     
  5. Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
     
  6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
     
  7. If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
     
  8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
     
  9. Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
     
  10. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
     
  11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
     
  12. No advertising or soliciting.
     
  13. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

Questioninclude nested object's property?membermp4mcd1 May '13 - 17:51 
Say I have these in-memory objects:
 
Team object. It has 2 properties:
Nickname (string)
City (another object)
 
City object. It has 1 property:
Population (int)
 
Using LINQ, how do I select the Nickname and Population into the same result? I tend to isolate the City object, then join to it using Population. Isn't there a better way?
 
Marty
AnswerRe: include nested object's property?memberMidwestLimey2 May '13 - 9:43 
I'm assuming you have a list of Teams, but given:
        public class Team
        {
            public string Nickname { get; set; }
            public City City { get; set; }
            // yada

        }
        public class City
        {
            public int Population { get; set; }
            // yada
        }
 
I suspect you're looking for something like ...
 
        IEnumerable<Team> teams = getMeSomeTeamsDagnamit();
        var result =
            from t in teams
            select new { t.Nickname, t.City.Population };
 
I'd suggest you read up on Anonymous Types [^] if you're not familiar.
062142174041062102

GeneralRe: include nested object's property?memberjohnnys appleseed3 May '13 - 3:22 
I realize now that my original sample code was too simplistic. In reality, the "Team" object was an (incorrect) projection from a "groupby", where the "City" wasn't available. We figured it out. Thanks for the info!
QuestionLinQ: sub items and root in DataTablemembernmc_aptech24 Apr '13 - 23:23 
Hi !

I have some codes below here:

DataTable objTable = new DataTable();
objTable.Columns.Add("ID");
objTable.Columns.Add("Name");
objTable.Columns.Add("Root");

DataRow objrow1 = objTable.NewRow();
objrow1["ID"] = "1";
objrow1["Name"] = "1";
objrow1["Root"] = "";
objTable.Rows.Add(objrow1);

objrow1 = objTable.NewRow();
objrow1["ID"] = "11";
objrow1["Name"] = "11";
objrow1["Root"] = "1";
objTable.Rows.Add(objrow1);

objrow1 = objTable.NewRow();
objrow1["ID"] = "12";
objrow1["Name"] = "12";
objrow1["Root"] = "1";
objTable.Rows.Add(objrow1);

objrow1 = objTable.NewRow();
objrow1["ID"] = "121";
objrow1["Name"] = "121";
objrow1["Root"] = "12";
objTable.Rows.Add(objrow1);

objrow1 = objTable.NewRow();
objrow1["ID"] = "2";
objrow1["Name"] = "2";
objrow1["Root"] = "";
objTable.Rows.Add(objrow1);

objrow1 = objTable.NewRow();
objrow1["ID"] = "21";
objrow1["Name"] = "21";
objrow1["Root"] = "2";
objTable.Rows.Add(objrow1);

And now, how can I list item and subitems in root is 1?Please help me !!!!
MCP.NET, MCAD.NET, MCSD.NET

AnswerRe: LinQ: sub items and root in DataTableprofessionalSimon_Whale24 Apr '13 - 23:36 
you will need to make sure that there is a reference to System.Data.DataSetExtensions in your project.
 
  var Results = from data in objTable.AsEnumerable()
                where data.Field<int>("Root") == 1
                select data
 

further reading
 
Linq query on a datatable[^]
Queries in LINQ to DataSet[^]
Every day, thousands of innocent plants are killed by vegetarians.
 
Help end the violence EAT BACON

GeneralRe: LinQ: sub items and root in DataTablemembernmc_aptech25 Apr '13 - 17:04 
Thanks !
 
It return two items: 11 and 12. But sub items of 12? How can I get its?
MCP.NET, MCAD.NET, MCSD.NET

QuestionLINQ Query / "between" datesmembermebjen18 Nov '12 - 7:17 
Hi All,
 
I've spent way to long on this - I'm trying to get distinct values from a dataTable: begDate = 2007-11-18 / endDate = 2007-12-31
 
Why does this work: Returns 4 rows
Dim shipTo = From row In osDS.Tables(0).AsEnumerable _
                                 Order By row(7) _
                                 Where row(0).ToString = cust _
                                 And row(1).ToString > begDate _
                                 Select row(7) Distinct
 
This doesn't work: Results Empty / Enumeration yield no results....
Dim shipTo = From row In osDS.Tables(0).AsEnumerable _
                                 Order By row(7) _
                                 Where row(0).ToString = cust _
                                 And row(1).ToString < endDate _
                                 Select row(7) Distinct
 
But what I really want is: (but it doesn't work either)
Dim shipTo = From row In osDS.Tables(0).AsEnumerable _
                                 Order By row(7) _
                                 Where row(0).ToString = cust _
                                 And row(1).ToString > begDate _
                                 And row(1).ToString < endDate _
                                 Select row(7) Distinct
 
Thanks in advance . . . .
 
MB
AnswerRe: LINQ Query / "between" datesmemberMatt T Heffron18 Nov '12 - 12:52 
Are begDate and endDate actually strings with the values "2007-11-18", "2007-12-31" respectively?
And what is the type of data in row(1)? Is it also a string, or is it a date?
If it is a date in that column, then it seems possible that taking the ToString() from date values is not using the same format as begDate and endDate are representing the date.
I'd suggest doing the comparison as date (DateTime) values to avoid any issues with cultural-specific date formatting.
QuestionComma separeted text filemembermarca29212 Nov '12 - 19:59 
Hi,
 
I have a comma separated text file and I want to get all SerialNumber for a specific device. Example: I want to get the SerialNumber for all Device:A1 => 345 and 347
 
ID:432,Name:Jones,SerialNumber:345,Device:A1
ID:432,Name:Mark,SerialNumber:347,Device:A1
ID:432,Name:Ann,SerialNumber:346,Device:A2
 
I have now solved this problem with a combination of linq, foreach and regex. How can I do this in one linq expression?
 
Best regards
Olof
AnswerRe: Comma separeted text filemembersavbace10 Jan '13 - 22:44 
Try to look at this LINQ to CSV library. I briefly explored it and seems it allows to get IEnumerable<T> from *.csv file and then use LINQ against it.
QuestionThe type of one of the expressions in the join clause is incorrect. Type inference failed in the call to GroupJoinmemberdotnet9516 Oct '12 - 14:28 
select a.LoanNum, PromiseAmt, isnull(SUM(PdAmt), 0) as PostedAmt
 from LoanPromises a with(nolock)
 left outer join LoanPayment lp with(nolock) on a.LoanNum = lp.LoanNum and a.PromiseDt < lp.PmtPostDt
 group by a.LoanNum, PromiseAmt
 having isnull(Sum(PdAmt),0) < PromiseAmt
 
Here is my linq query
 
var query = from pmts in oLoan.LoanPayments
     join promise in oLoan.LoanPromiseToPays
    on new { p1 = pmts.LoanNum, p2 = pmts.PmtPostDt} equals new {LoanNum = promise.LoanNum, PmtPostDt = promise.PromiseDt } into outer
 from defaulted in outer.DefaultIfEmpty()
 group defaulted by promise.LoanNum && promise.PromiseAmt into grouped
 select new
 {
    LoanNum = grouped.Key,
    Sum = grouped.Sum(t => t.PdAmt < t.PromiseAmt),
    PmtPostDt = promise.PromiseDt ?? default(DateTime)
 }
 

AnswerRe: The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to GroupJoinmemberRichard Deeming22 Oct '12 - 2:19 
Try taking out the p1 = and p2 = from the LHS of your join.
 
At the moment, you have:
on new { p1 = ..., p2 = ...} equals new { LoanNum = ..., PmtPostDt = ... }
The compiler has no way to map one key to the other, since the property names are different.
 
Also, your LINQ join won't match your SQL join. The SQL has promise.PromiseDate < payment.PmtPostDt, but your LINQ query has promise.PromiseDate = payment.PmtPostDt instead.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionLINQmemberJabbarJahambana3 Oct '12 - 22:04 
Please give me tips to study LINQ easily
AnswerRe: LINQprotectorPete O'Hanlon3 Oct '12 - 22:22 
Install LINQPad[^]. Try out the samples in it. Buy the book it's associated with and read that.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

AnswerRe: LINQmemberProgramFOX5 Oct '12 - 5:33 
Here you find a LINQ tutorial:
http://msdn.microsoft.com/en-us/library/bb397933%28v=vs.100%29.aspx[^]
AnswerRe: LINQmemberemma926 Dec '12 - 6:23 
Here's the link:
http://msdn.microsoft.com/en-us/library/bb397933.aspx[^]
AnswerRe: LINQmembertunheo24 Dec '12 - 22:17 
You can visit link:
http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b[^]
GeneralMessage Automatically RemovedmemberMahesh Sellamuthu12 Feb '13 - 20:09 
Message Automatically Removed
Suggestionlinq to sql obtain foreign key valuemembersc steinhayse24 Aug '12 - 19:40 
In a C# 2010 application that I am working on, I want to use linq to sql to update 2 tables in a sql server 2008 database.
 
I want to do the following:
create new Table1 object ;
InsertOnSubmit(tbl1)
**Table 1 will contain the primary key.
create new Table2 object;
table2 will contain a foreign key column that refers to primary key in
table1 object.
InsertOnSubmit(tbl2)
SubmitChanges()
 
Before and/or right after the submitchanges() event occurs, I would like to know what the value is for the primary key in table1 and the foreign key value is in table2. I would like to know what the table key value is so I can display this information on reports that will be generated right after the record(s) have been inserted into the database. Thus can you tell me how to determine what the primary key value is for table1 that also refers to the foreign key value in table 2?
GeneralRe: linq to sql obtain foreign key valuememberrs_engg5 Sep '12 - 3:43 
Hi,
 
using (TransactionScope ts = new TransactionScope())
{
    InsertOnSubmit(tbl1);
    SubmitChanges();
    int val1= tbl1.PrimaryKey;
 
    InsertOnSubmit(tbl2);
    SubmitChanges();
    int val2= tbl1.foreignKey;
 
    if (strError == "")
     {
          SubmitChanges();
 
          ts.Complete();  // now both inserts are committed to the db
      }
 
}

Questionminus returned value during executing a insert stored procedurememberMember 870070423 Aug '12 - 5:37 
hi
I have a stored procedure in SQL Server 2005 for inserting in a table ; when I'm executing this procedure it works but also return a minus value?!why? what a minus returned value means here?
Thank you...
my code in C#:
string connSt = "Data Source=localhost;Initial Catalog=Status;Integrated Security=true;User ID=sa;Password=45637;Timeout=20000";
SqlConnection conn1 = new SqlConnection(connSt);
conn1.Open();
SqlCommand command = new SqlCommand("insertIninterface", conn1);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@interfaceName", SqlDbType.NVarChar).Value = textBox1.Text;
command.Parameters.Add("@interfaceIP", SqlDbType.NVarChar).Value = textBox2.Text;
command.Parameters.Add("@interfaceType", SqlDbType.Int).Value = textBox3.Text;
command.Parameters.Add("@maxValAllowed", SqlDbType.Int).Value = textBox4.Text;
command.Parameters.Add("@status", SqlDbType.Int).Value = textBox5.Text;
int rows = command.ExecuteNonQuery();
conn1.Close();
if (rows == 1)
{
MessageBox.Show("Success");
}
else
{
MessageBox.Show("Failed");
}
 

my stored procedure in SQL Server 2005:
 
@interfaceName nvarchar(50) ,
@interfaceIP nvarchar(50) ,
@interfaceType int ,
@maxValAllowed int ,
@status int
AS
BEGIN
SET NOCOUNT ON;
insert into interface(interfaceName,interfaceIP,interfaceType,maxValAllowed,status) values(@interfaceName,@interfaceIP,@interfaceType,@maxValAllowed,@status)
END
AnswerRe: minus returned value during executing a insert stored procedurememberWes Aday23 Aug '12 - 6:00 
What does this have to do with LINQ?
 
When SET NOCOUNT is ON, the count is not returned.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012

AnswerRe: minus returned value during executing a insert stored procedurememberBobJanova23 Aug '12 - 6:14 
The SP isn't returning a value. The 'return value' could be coming from anywhere, even being just what was lying around in some piece of memory from the previous query. If you want to check that the insert statement worked, don't SET NOCOUNT and return the result of it from the SP.
QuestionLINQ or ADO.NET ?memberpashmakjoon19 Aug '12 - 10:11 
please help me.
LINQ or ADO.NET? and why?
 
Rose | [Rose]
AnswerRe: LINQ or ADO.NET ?mvpRichard MacCutchan19 Aug '12 - 23:03 
See here[^].
One of these days I'm going to think of a really clever signature.

AnswerRe: LINQ or ADO.NET ?mvpthatraja20 Aug '12 - 0:39 
Please complete your question always.
pashmakjoon wrote:
LINQ or ADO.NET? and why?
Real answer is Depends. Check these discussions.
LinQ vs Entity Framework vs ADO.NET vs nHibernate :- Which is best?[^]
ADO.NET vs LINQ vs ENTITY FRAMEWORK vs SQL[^]

GeneralRe: LINQ or ADO.NET ?membermanijasmine20 Aug '12 - 8:07 
Ado.net have the following type of providers to access the database
ODBC Data Provider
OleDb Data Provider
Oracle Data Provider
SQL Data Provider
Borland Data Provider
 
linq contains the language integrated query .we can simplify the sqlquery and handle easily and reduce the memory space
AnswerRe: LINQ or ADO.NET ?memberKolkata .NET8 Mar '13 - 5:45 
LINQ with DBML makes wwork easy for me. atleast don't have to deal with ADOHelper files.
 
the best part is for LINQ - not only intellisense tells you those functions but also about fields/properties of those entities. and that makes things lot easier
Questionhow to load and save an xml document using linqmemberowobs15 Aug '12 - 1:57 
i'm hving difficulty in saving and loading an xml document using linq. kindly help me out.
AnswerRe: how to load and save an xml document using linqmentorWayne Gaylard15 Aug '12 - 2:16 
Go through this tutorial LINQ to XML - C# Tutorial[^]. This topic is too big to answer in a forum.
 
Hope this helps.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman

QuestionCreating a dynamic where clausememberSimon_Whale9 Aug '12 - 0:06 
I have the requirements to change a method, in particular a LINQ query to return results on various permutations of 2 variables (Postcode, Surname) which would result in changing the where clause as shown in the highlighted row below. But instead of re-writing the statement for the 3 different where clauses I want to be able to reuse as much as possible.
 
  var PeopleRecordsSearch = from SomePeople in Person()
                                          join SomeClient in Client() on SomePeople.PersonID equals SomeClient.PersonID
                                          where SomePeople.Surname.Contains(Surname) && SomePeople.Surname.Length > 0 && SomeClient.Postcode == Postcode 
                                          select SomePeople;
 
I have looked at using the Func which works great when the results (i.e. the select statement) are the same as the in variable i.e.
 
Func<Tables.Person, bool> WhereSurname = p => p.Surname = Surname;
 
which I can run then as
 
PeopleRecordSearch.Where(WhereSurname).ToList();
 
but if I want to search the Postcode of the Client table with this
 
Func<Tables.Client, bool> WherePostcode = p => p.Postcode == Postcode;
 
I get the following error in Visual Studio
 
Argument 2: cannot convert from 'System.Func' to 'System.Linq.Expressions.Expression>' Person.cs 125 69
 
Which I know is the Func statement.
 
My question is, is there a way that I can re use the main body of the query and write a dynamic where clause into the statement or the results by doing PeopleRecordSearch.Where(FuncArgument).ToList();?
 

Thanks
Simon
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

AnswerRe: Creating a dynamic where clauseprotectorPete O'Hanlon9 Aug '12 - 0:22 
Simon, this is your lucky day. First of all, let's change your initial query like this:
var PeopleRecordsSearch = from SomePeople in Person()
                                          join SomeClient in Client() on SomePeople.PersonID equals SomeClient.PersonID
                                          select SomePeople;
Now, to search on the postcode, do this:
var postcodeSearch = (from people in PeopleRecordsSearch
where people.Postcode == Postcode
select people).ToList();
Similarly, to do your postcode search do this:
var surnameSearch = (from people in PeopleRecordsSearch
where people.Surname.Contains(Surname)
select people).ToList();
This works because the first query is actually an IQueryable, which means that it isn't executed (this is known as deferred execution). The beauty about this is that you can create a base query, and then refine it at a later stage.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: Creating a dynamic where clausememberSimon_Whale9 Aug '12 - 0:26 
Thanks Pete
 
that makes sense! its always the simple solutions that you forget Big Grin | :-D
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

GeneralRe: Creating a dynamic where clausememberBobJanova9 Aug '12 - 2:11 
Good answer.
 
Remember that with intermediate IQueryables, you want to stay away from anything that can cause the query to be evaluated. That's mostly obvious things like ToList or iterating over it; I'm not sure if there are any weird gotchas like making grouped or summary queries from one.
GeneralRe: Creating a dynamic where clausememberSimon_Whale9 Aug '12 - 3:10 
When Pete mentioned it, the reading about deferred execution came flooding back and I was assuming that the solution at the time was going to be some black magic approach.
 
But questions like this always makes me realise that I should of attempted the simple / basic solutions first! D'Oh! | :doh:
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

GeneralRe: Creating a dynamic where clauseprotectorPete O'Hanlon9 Aug '12 - 3:40 
I do simple very well. At least I think that's what the wife means when she describes me as simple.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: Creating a dynamic where clausememberSimon_Whale9 Aug '12 - 3:44 
Laugh | :laugh:
 
Thanks for your help earlier Pete it works like a charm! Now onto my next crisis feature to include
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch

QuestionLinq where dates questionmemberMember 78188928 Jul '12 - 13:23 
Hi folks
 
This expression works fine without the where clause:
 
var someQuery = from some in context.OGsome

where ((some.Due_Date >= some.Base_Date.Value.AddDays(-70)) && (some.Due_Date <= some.Base_Date.Value.AddDays(+70)) )

 
select some;
 
I am trying to limit the query to between +/- 70 days. I keep getting an exception.
 
Many thanks for any help resolving this.
Mike
AnswerRe: Linq where dates questionprotectorPete O'Hanlon8 Jul '12 - 19:51 
What is the exception?

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

AnswerRe: Linq where dates questionmemberBobJanova9 Jul '12 - 1:41 
Is that column a DATETIME in the database?
 
Is some.Base_Date something which can be known at the time the expression is compiled into a SQL query? Try storing the bounds in local variables.
AnswerRe: Linq where dates questionmemberMatt T Heffron11 Jul '12 - 8:41 
So it appears that Due_Date and Base_Date are both columns in the DB (properties in the Entity object?)
Why do you use the .Value property with Base_Date and not with Due_Date?
Are they both Nullable?
What happens if either is null?
(An exception? hint, hint)
AnswerRe: Linq where dates questionmemberMatt T Heffron27 Jul '12 - 14:35 
So...did it get solved?
Questionlinq to sql connection string namememberrachel_m6 Jul '12 - 6:31 
I am working with a C#.net 2010 web form that uses linq to sql to connect to a sql server 2008 r2 database. In one of the connection strings in a linq to sql ( *.dbml) file, the connection string is set to is set to dbconnectionstring(settings). I want to change the connection string to dbConnectionString (Web.config), however where I am clicking on, will not let me change the connection string.
I have opened up the designer for the .dbml file and clicked properties. Where the connection string is setup, I can change that to a new connnection string.
If that is where I can the connection string, how do I get the visual studio ide to allow me to change the connection string to dbConnectionString (Web.config)?
AnswerRe: linq to sql connection string namememberBobJanova9 Jul '12 - 1:42 
Can't you just edit the DBML file in text mode? I think it's human readable (XML?).
QuestionConvert SQL to LINQmemberdivesh123 Jul '12 - 9:47 
select SUM(total)
from MyTax mt1
inner join (
select Code,ID,TaxYear,Data,max(date) as FinalDate
from MyTax
group by Code,ID,TaxYear,Data) mt2
on mt1.Code = mt2.Code and mt1.ID = mt2.ID
and mt1.Data = mt2.Data and mt1.TaxYear = mt2.TaxYear
and mt1.date = mt2.date

QuestionRe: Convert SQL to LINQmemberNaerling12 Jul '12 - 6:01 
What is it exactly that you want? What have you tried? Where are you stuck?
We can't help you if you don't ask a question...
It's an OO world.
public class Naerling : Lazy<Person>{
    public void DoWork(){ throw new NotImplementedException(); }
}

AnswerRe: Convert SQL to LINQmvpthatraja20 Aug '12 - 0:32 
Sorry, we don't spoon-feed. Take a look at this article & try yourself.
Learn SQL to LINQ (Visual Representation)[^]

AnswerRe: Convert SQL to LINQmemberEmmanuel Medina Lopez18 Sep '12 - 8:40 
As Naerling and thatraja pointed out, there is no question, and we don't spood-feed, read the article thatraja linked, or if you are lazy brain-wise, buy Linqer (or any other SQL to LINQ conversion tool).

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid