Why it pulls all the fields

Posts   
 
    
imakimak
User
Posts: 62
Joined: 18-Mar-2010
# Posted on: 08-Feb-2013 17:59:14   

Self Servicing .NET 3.5 SQL Server 2008 I have a table MyTable and I have following code. I expect that query will only fetch Column1 and Column2 but for some reason its pulling back several other columns. Any ideas what I may be doing wrong here?

MyTableCollection Collection = new MyTableCollection();
ExcludeIncludeFieldsList fields = new ExcludeIncludeFieldsList(false);
fields.Add(MyTableFields.Column1);
fields.Add(MyTableFields.Column2);

Collection.GetMulti(new PredicateExpression(MyTableFields.ID == SomeId ), fields,  null);
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Feb-2013 06:11:35   

I can't reproduce it, so it seems there is no bug there. - What LLBLGen runtime version are you using? (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725). Make sure to use the latest. - Is that you real code? Please post the real code as there might be some clue there. - Note that the PK fields are always fetched, despite of what you have in your include fields collection.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 09-Feb-2013 10:32:57   

so are FK fields. So whatever you do, pk & fk fields are fetched regardless of what you specify as excluded/included.

Frans Bouma | Lead developer LLBLGen Pro