Click here to Skip to main content
15,897,273 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionPulling data from interface Pin
oPhoenixo25-Sep-12 4:54
oPhoenixo25-Sep-12 4:54 
AnswerRe: Pulling data from interface Pin
David Mujica25-Sep-12 5:56
David Mujica25-Sep-12 5:56 
GeneralRe: Pulling data from interface Pin
oPhoenixo25-Sep-12 6:30
oPhoenixo25-Sep-12 6:30 
AnswerRe: Pulling data from interface Pin
jkirkerx25-Sep-12 10:54
professionaljkirkerx25-Sep-12 10:54 
QuestionManaging Long Running Processes Pin
Adwaitam25-Sep-12 2:26
Adwaitam25-Sep-12 2:26 
AnswerRe: Managing Long Running Processes Pin
Richard MacCutchan25-Sep-12 6:09
mveRichard MacCutchan25-Sep-12 6:09 
AnswerRe: Managing Long Running Processes Pin
jkirkerx25-Sep-12 11:21
professionaljkirkerx25-Sep-12 11:21 
QuestionLoadWith is not allowed after freeze or attach to DataContext Pin
nitin_ion24-Sep-12 21:27
nitin_ion24-Sep-12 21:27 
this is the code

static DataLoadOptions objDataLoadOption = GetDataLoadOpt();

public static DataLoadOptions GetDataLoadOpt()
        {
            DataLoadOptions dlo = new DataLoadOptions();
            dlo.LoadWith<clsCustomerWithAddresses>(c => c.Addresses);
            dlo.LoadWith<clsAddresses>(clsAddresses => clsAddresses.Phone);
            return dlo;
        }



this workd fine when i try to call it

XML
objContext.LoadOptions = objDataLoadOption;
var MyQuery = from objCustomer in objContext.GetTable<clsCustomerWithAddresses>()
                             select objCustomer;



I want to change the loadwith option
for this i used reflection to check the forzen variable in dataloadoptions

XML
var freeze = typeof(DataLoadOptions).GetField("frozen", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(objDataLoadOption);

if ((bool)freeze == true)
    {
        objDataLoadOption = new DataLoadOptions();
        objDataLoadOption.LoadWith<clsPhone>(p => p.MobilePhone);
        objContext.LoadOptions = objDataLoadOption;



all this works fine. Issue comes after some time. after 2-3 weeks i start getting
LoadWith is not allowed after freeze or attach to DataContext

any idea why i am getting this and how can it be stopped
AnswerRe: LoadWith is not allowed after freeze or attach to DataContext Pin
n.podbielski28-Sep-12 0:38
n.podbielski28-Sep-12 0:38 
Questioncheck box Pin
bilal khatri24-Sep-12 4:09
bilal khatri24-Sep-12 4:09 
AnswerRe: check box Pin
Mohibur Rashid24-Sep-12 16:11
professionalMohibur Rashid24-Sep-12 16:11 
AnswerRe: check box Pin
wikizhao25-Sep-12 0:00
wikizhao25-Sep-12 0:00 
AnswerRe: check box Pin
gopal pradhan8-Nov-12 23:23
gopal pradhan8-Nov-12 23:23 
QuestionMVC - How are you scripting..? Pin
Dylan Morley24-Sep-12 3:16
Dylan Morley24-Sep-12 3:16 
AnswerRe: MVC - How are you scripting..? Pin
John-ph25-Sep-12 20:39
John-ph25-Sep-12 20:39 
GeneralRe: MVC - How are you scripting..? Pin
Dylan Morley26-Sep-12 3:08
Dylan Morley26-Sep-12 3:08 
GeneralRe: MVC - How are you scripting..? Pin
John-ph26-Sep-12 17:57
John-ph26-Sep-12 17:57 
QuestionHow to copy the content of textbox to the clipboard Pin
vinay_sinha23-Sep-12 21:25
vinay_sinha23-Sep-12 21:25 
QuestionCreating Textboxes Dynamically Pin
ASPnoob23-Sep-12 2:53
ASPnoob23-Sep-12 2:53 
AnswerRe: Creating Textboxes Dynamically Pin
Vani Kulkarni23-Sep-12 18:32
professionalVani Kulkarni23-Sep-12 18:32 
AnswerRe: Creating Textboxes Dynamically Pin
vinay_sinha23-Sep-12 20:59
vinay_sinha23-Sep-12 20:59 
AnswerRe: Creating Textboxes Dynamically Pin
ema2000_t24-Sep-12 11:55
ema2000_t24-Sep-12 11:55 
AnswerRe: Creating Textboxes Dynamically Pin
n.podbielski28-Sep-12 1:12
n.podbielski28-Sep-12 1:12 
AnswerRe: Creating Textboxes Dynamically Pin
RichardGrimmer28-Sep-12 4:11
RichardGrimmer28-Sep-12 4:11 
Questionasp.net web form or asp.net mvc ?? Pin
Mohamad Shahmardan22-Sep-12 13:04
Mohamad Shahmardan22-Sep-12 13:04 

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.