Click here to Skip to main content
15,905,915 members
Home / Discussions / C#
   

C#

 
AnswerRe: MDI children instances, how to code Pin
DaveyM6918-Aug-08 22:52
professionalDaveyM6918-Aug-08 22:52 
AnswerRe: MDI children instances, how to code Pin
ianhunt0119-Aug-08 8:56
ianhunt0119-Aug-08 8:56 
GeneralRe: MDI children instances, how to code Pin
DaveyM6919-Aug-08 11:10
professionalDaveyM6919-Aug-08 11:10 
QuestionHow to bind hardcoded DataGridView with DataTable Pin
Piyush Vaishnav18-Aug-08 19:24
Piyush Vaishnav18-Aug-08 19:24 
AnswerRe: How to bind hardcoded DataGridView with DataTable Pin
AhsanS18-Aug-08 19:33
AhsanS18-Aug-08 19:33 
Questionsource code of scannig image from web cam in vb.net or in c# Pin
shp_ptn18-Aug-08 19:02
shp_ptn18-Aug-08 19:02 
AnswerRe: source code of scannig image from web cam in vb.net or in c# Pin
AhsanS18-Aug-08 19:24
AhsanS18-Aug-08 19:24 
QuestionLinq Noob, stuck on type inference... Pin
callingshotgun18-Aug-08 18:54
callingshotgun18-Aug-08 18:54 
I'm trying to wrap my head around using LINQ and lambda expressions in c# 3.0, and as such I threw together a short (presumably) simple exercise- A general function that will take an IEnumerable and return a concatonation of the string representations of each of the elements contained therein.

public String concat(ICollection values )
{
return values.Cast<object>().Aggregate((Object x, Object y) => x.ToString() + y.ToString());
}

However, when I try to run this little gem, I get the following:

"The type arguments for method 'System.Query.Sequence.Aggregate<t>, System.Query.Func<t,t,t>)' cannot be inferred from the usage. Try specifying the type arguments explicitly"

Googling revealed that this error is usually the result of saying (x,y) => ... instead of explicitly typing X and Y the way you would when defining the parameters in a method. Makes sense, except that I'm explicitly saying "(Object x, Object y)". Further, when I change all instances of "Object" to "String" (which I don't want to do for the final version, as I want this to work for any type of object), it works without a hitch. I don't understand why that makes a difference, since I'm calling ToString() on the object to get the string out, and "ToString()" works for any object. Is this a failing of the type inference system? Or am I just completely glossing over something?

Much appreciated.
AnswerRe: Linq Noob, stuck on type inference... Pin
leppie18-Aug-08 22:14
leppie18-Aug-08 22:14 
GeneralRe: Linq Noob, stuck on type inference... Pin
callingshotgun19-Aug-08 5:06
callingshotgun19-Aug-08 5:06 
GeneralRe: Linq Noob, stuck on type inference... Pin
leppie19-Aug-08 5:47
leppie19-Aug-08 5:47 
GeneralRe: Linq Noob, stuck on type inference... Pin
callingshotgun19-Aug-08 6:06
callingshotgun19-Aug-08 6:06 
QuestionPInvoke Heartburn Pin
ahfong18-Aug-08 14:33
ahfong18-Aug-08 14:33 
AnswerRe: PInvoke Heartburn Pin
leppie18-Aug-08 22:08
leppie18-Aug-08 22:08 
QuestionShould GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
JoeRip18-Aug-08 11:46
JoeRip18-Aug-08 11:46 
AnswerRe: Should GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
Colin Angus Mackay18-Aug-08 12:41
Colin Angus Mackay18-Aug-08 12:41 
GeneralRe: Should GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
JoeRip18-Aug-08 14:19
JoeRip18-Aug-08 14:19 
GeneralRe: Should GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
Colin Angus Mackay18-Aug-08 21:06
Colin Angus Mackay18-Aug-08 21:06 
GeneralRe: Should GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
JoeRip18-Aug-08 21:12
JoeRip18-Aug-08 21:12 
AnswerRe: Should GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
Guffa18-Aug-08 22:00
Guffa18-Aug-08 22:00 
GeneralRe: Should GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
JoeRip18-Aug-08 22:07
JoeRip18-Aug-08 22:07 
AnswerRe: Should GenericQueue.Enqueue work while a different thread has LOCK(GenericQueue) ? Pin
Guffa18-Aug-08 12:41
Guffa18-Aug-08 12:41 
Question[Message Deleted] Pin
JoeRip18-Aug-08 11:12
JoeRip18-Aug-08 11:12 
AnswerRe: Why doesn't Queue.Enqueue fail when Queue is locked? Pin
led mike18-Aug-08 11:22
led mike18-Aug-08 11:22 
QuestionCode To Check Email Errors Pin
Kevin Marois18-Aug-08 10:56
professionalKevin Marois18-Aug-08 10:56 

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.