strange problem using dotconnect
Posted: Wed 30 Nov 2011 10:21
hi,
here's a description of the code with the problem:
DB.MainDataContext context = new DB.MainDataContext();
var sections = from s in context.Sections orderby s.Title select s;
foreach(var section in sections){
*var place = from p in context.Places where p.SectionId == section.Id orderby p.Title select p;
if ( *place. ?
first potential problem/question (*) can I use "var" inside a foreach loop?
isn't it a problem?
* the main problem: when typing "place." (which is the linq object) the intellisense does'nt display all the property fields existing in "place".
it was supposed to popup. so I understand that something with the declarations I've made is wrong, because visual studio doesn't recognize "place".
does anyone got a clue ?
thanks in advanced.
Shahar Weinstein.
here's a description of the code with the problem:
DB.MainDataContext context = new DB.MainDataContext();
var sections = from s in context.Sections orderby s.Title select s;
foreach(var section in sections){
*var place = from p in context.Places where p.SectionId == section.Id orderby p.Title select p;
if ( *place. ?
first potential problem/question (*) can I use "var" inside a foreach loop?
isn't it a problem?
* the main problem: when typing "place." (which is the linq object) the intellisense does'nt display all the property fields existing in "place".
it was supposed to popup. so I understand that something with the declarations I've made is wrong, because visual studio doesn't recognize "place".
does anyone got a clue ?
thanks in advanced.
Shahar Weinstein.