runtime error "invalidoperation exception" ?
-
hi, I made the following linq to sql query and it seems to be working fine because the number of rows returned is exactly wat i wanted but now i can't retrieve my information from it... i am pasting the code below, with the error ,please provide help var d = (from a in db.GetTable() group a by a.name into g select new { g.Min().id,g.Min().name }); Dictionary<int,> dictMinIdPart = new Dictionary<int,>(); foreach (var c in d) { dictMinIdPart.Add(c.id, c.name); } Error: runtime error Invalidoperationexception Could not format node 'New' for execution as SQL thanx for ur help in advance best regards
haseeb
-
hi, I made the following linq to sql query and it seems to be working fine because the number of rows returned is exactly wat i wanted but now i can't retrieve my information from it... i am pasting the code below, with the error ,please provide help var d = (from a in db.GetTable() group a by a.name into g select new { g.Min().id,g.Min().name }); Dictionary<int,> dictMinIdPart = new Dictionary<int,>(); foreach (var c in d) { dictMinIdPart.Add(c.id, c.name); } Error: runtime error Invalidoperationexception Could not format node 'New' for execution as SQL thanx for ur help in advance best regards
haseeb
Hello! the group g has the properties Key and Group. The Key is name, since you grouped by name. The group is a collection of all items with the same name. What are you trying to accomplish with teh query?
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn.
What you don't know. We teach -
Hello! the group g has the properties Key and Group. The Key is name, since you grouped by name. The group is a collection of all items with the same name. What are you trying to accomplish with teh query?
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn.
What you don't know. We teachhi , thanx for ur help... well actually, i was working with a table that had a number of repeated values with different primary keys, i needed only distinct name and it's key so i thought of using a dictionary coz it sounded as if dictionary can store 2 values as opposed to lists... correct me if i am wrong with the idea of dictionary... Anyways , thanx alot and thanx for clarifying the key things...i was confused regarding keys... thanx