Click here to Skip to main content
16,013,642 members
Home / Discussions / C#
   

C#

 
QuestionFormatting text in text boxes Pin
ASPnoob19-Feb-10 16:59
ASPnoob19-Feb-10 16:59 
AnswerRe: Formatting text in text boxes Pin
tonyonlinux19-Feb-10 17:14
tonyonlinux19-Feb-10 17:14 
GeneralRe: Formatting text in text boxes Pin
AspDotNetDev19-Feb-10 17:19
protectorAspDotNetDev19-Feb-10 17:19 
AnswerRe: Formatting text in text boxes Pin
AspDotNetDev19-Feb-10 17:16
protectorAspDotNetDev19-Feb-10 17:16 
Questionhow would i do a groupby in this instance ?[modified] Pin
tonyonlinux19-Feb-10 16:54
tonyonlinux19-Feb-10 16:54 
AnswerRe: how would i do a groupby in this instance Pin
Dan Mos19-Feb-10 17:21
Dan Mos19-Feb-10 17:21 
GeneralRe: how would i do a groupby in this instance Pin
tonyonlinux19-Feb-10 18:05
tonyonlinux19-Feb-10 18:05 
GeneralRe: how would i do a groupby in this instance Pin
Dan Mos19-Feb-10 18:41
Dan Mos19-Feb-10 18:41 
well thats easy

C#
//either repalce
List<FillGrid> distinctresults = query.GroupBy(i => i.BookID).Select(i => i.FirstOrDefault());
//with
List<FillGrid> distinctresults = query.GroupBy(i => i.BookID).Select(i => i.FirstOrDefault()).ToList();
//or with
var distinctresults = query.GroupBy(i => i.BookID).Select(i => i.FirstOrDefault());


A LINQ query returns an IEnumerable by default and it does not get exectuted right away.

Only when you do something with it.

But if you call the .ToList() it will execute it and cache the results.
GeneralRe: how would i do a groupby in this instance Pin
tonyonlinux19-Feb-10 18:55
tonyonlinux19-Feb-10 18:55 
QuestionMoving form without showing contents Pin
desto-tj19-Feb-10 14:55
desto-tj19-Feb-10 14:55 
GeneralREPOST Pin
AspDotNetDev19-Feb-10 15:07
protectorAspDotNetDev19-Feb-10 15:07 
AnswerRe: Moving form without showing contents Pin
Som Shekhar19-Feb-10 18:57
Som Shekhar19-Feb-10 18:57 
GeneralRe: Moving form without showing contents Pin
desto-tj19-Feb-10 20:38
desto-tj19-Feb-10 20:38 
GeneralRe: Moving form without showing contents Pin
Som Shekhar19-Feb-10 20:59
Som Shekhar19-Feb-10 20:59 
GeneralRe: Moving form without showing contents Pin
desto-tj19-Feb-10 21:08
desto-tj19-Feb-10 21:08 
GeneralRe: Moving form without showing contents Pin
Dan Mos20-Feb-10 21:16
Dan Mos20-Feb-10 21:16 
QuestionAbout property grid. Pin
gaferrero19-Feb-10 13:57
gaferrero19-Feb-10 13:57 
AnswerRe: About property grid. Pin
AspDotNetDev19-Feb-10 14:13
protectorAspDotNetDev19-Feb-10 14:13 
Questioninternet Pin
sanforjackass19-Feb-10 11:58
sanforjackass19-Feb-10 11:58 
AnswerRe: internet Pin
AspDotNetDev19-Feb-10 12:28
protectorAspDotNetDev19-Feb-10 12:28 
GeneralRe: internet Pin
sanforjackass19-Feb-10 12:40
sanforjackass19-Feb-10 12:40 
GeneralRe: internet Pin
AspDotNetDev19-Feb-10 12:46
protectorAspDotNetDev19-Feb-10 12:46 
GeneralRe: internet Pin
harold aptroot19-Feb-10 12:49
harold aptroot19-Feb-10 12:49 
GeneralRe: internet Pin
AspDotNetDev19-Feb-10 12:56
protectorAspDotNetDev19-Feb-10 12:56 
GeneralRe: internet Pin
harold aptroot19-Feb-10 12:58
harold aptroot19-Feb-10 12:58 

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

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