Click here to Skip to main content
       

LINQ

 
Suggestionlinq to sql obtain foreign key value Pinmembersc steinhayse24-Aug-12 19:40 
GeneralRe: linq to sql obtain foreign key value Pinmemberrs_engg5-Sep-12 3:43 
Questionminus returned value during executing a insert stored procedure PinmemberMember 870070423-Aug-12 5:37 
AnswerRe: minus returned value during executing a insert stored procedure PinmemberWes Aday23-Aug-12 6:00 
AnswerRe: minus returned value during executing a insert stored procedure PinmemberBobJanova23-Aug-12 6:14 
QuestionLINQ or ADO.NET ? Pinmemberpashmakjoon19-Aug-12 10:11 
AnswerRe: LINQ or ADO.NET ? PinmvpRichard MacCutchan19-Aug-12 23:03 
AnswerRe: LINQ or ADO.NET ? Pinmvpthatraja20-Aug-12 0:39 
GeneralRe: LINQ or ADO.NET ? Pinmembermanijasmine20-Aug-12 8:07 
AnswerRe: LINQ or ADO.NET ? PinmemberKolkata .NET8-Mar-13 5:45 
Questionhow to load and save an xml document using linq Pinmemberowobs15-Aug-12 1:57 
AnswerRe: how to load and save an xml document using linq PinmentorWayne Gaylard15-Aug-12 2:16 
QuestionCreating a dynamic where clause PinmemberSimon_Whale9-Aug-12 0:06 
AnswerRe: Creating a dynamic where clause PinprotectorPete 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 clause PinmemberSimon_Whale9-Aug-12 0:26 
GeneralRe: Creating a dynamic where clause PinmemberBobJanova9-Aug-12 2:11 
GeneralRe: Creating a dynamic where clause PinmemberSimon_Whale9-Aug-12 3:10 
GeneralRe: Creating a dynamic where clause PinprotectorPete O'Hanlon9-Aug-12 3:40 
GeneralRe: Creating a dynamic where clause PinmemberSimon_Whale9-Aug-12 3:44 
QuestionLinq where dates question PinmemberMember 78188928-Jul-12 13:23 
AnswerRe: Linq where dates question PinprotectorPete O'Hanlon8-Jul-12 19:51 
AnswerRe: Linq where dates question PinmemberBobJanova9-Jul-12 1:41 
AnswerRe: Linq where dates question PinmemberMatt T Heffron11-Jul-12 8:41 
AnswerRe: Linq where dates question PinmemberMatt T Heffron27-Jul-12 14:35 
Questionlinq to sql connection string name Pinmemberrachel_m6-Jul-12 6:31 
AnswerRe: linq to sql connection string name PinmemberBobJanova9-Jul-12 1:42 
QuestionConvert SQL to LINQ Pinmemberdivesh123-Jul-12 9:47 
QuestionRe: Convert SQL to LINQ PinmemberNaerling12-Jul-12 6:01 
AnswerRe: Convert SQL to LINQ Pinmvpthatraja20-Aug-12 0:32 
AnswerRe: Convert SQL to LINQ PinmemberEmmanuel Medina Lopez18-Sep-12 8:40 
QuestionLinq to sql , one column is inserting NULL value , Pinmemberooffooooo19-Jun-12 20:59 
AnswerRe: Linq to sql , one column is inserting NULL value , [modified] PinprotectorPete O'Hanlon19-Jun-12 23:55 
GeneralRe: Linq to sql , one column is inserting NULL value , Pinmemberabdul420-Jun-12 7:04 
QuestionRuntime error Could not load file or assemly from Linq Entity constructor Pinmembergmeiring17-Jun-12 9:13 
AnswerRe: Runtime error Could not load file or assemly from Linq Entity constructor PinmemberZac Greve12-Aug-12 17:59 
Questionhow can write linq insert ,update,delete queries Pinmemberdipen mistry13-Jun-12 1:52 
AnswerRe: how can write linq insert ,update,delete queries PinmemberAndy_L_J14-Jun-12 19:37 
Questionlinq PingroupSukanta201213-May-12 1:48 
AnswerRe: linq PinmvpRichard MacCutchan13-May-12 3:14 
AnswerRe: linq Pinmemberamitgajjar4-Jun-12 2:25 
AnswerRe: linq Pinmembermr.priyank14-Jun-12 18:07 
AnswerRe: linq Pinmember Shelby Robertson 12-Jul-12 4:27 
JokeRe: linq Pinmember Shelby Robertson 17-Jul-12 5:29 
QuestionRe: linq PinprotectorPete O'Hanlon17-Jul-12 5:50 
GeneralRe: linq Pinmember Shelby Robertson 17-Jul-12 5:57 
GeneralRe: linq Pinmembercsizo1-Aug-12 11:19 
AnswerRe: linq PinmemberProgramFOX25-Sep-12 7:24 
QuestionWindows Forms, Entity Framework, Data Binding, threading PinmemberDana Gehm19-Apr-12 12:08 
QuestionHow can write vb SQL insert code in linq [modified] PinmemberMember 802221810-Apr-12 1:37 
AnswerRe: How can write vb SQL insert code in linq Pinmemberrafaelmartir16-Apr-12 11:25 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 20 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid