Click here to Skip to main content
15,925,250 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: To Web Pages or not to Web Pages? Pin
Oshtri Deka26-Sep-12 11:12
professionalOshtri Deka26-Sep-12 11:12 
GeneralRe: To Web Pages or not to Web Pages? Pin
John-ph26-Sep-12 18:24
John-ph26-Sep-12 18:24 
AnswerRe: To Web Pages or not to Web Pages? Pin
Dylan Morley26-Sep-12 5:04
Dylan Morley26-Sep-12 5:04 
GeneralRe: To Web Pages or not to Web Pages? Pin
n.podbielski28-Sep-12 0:27
n.podbielski28-Sep-12 0:27 
Questiondateformat Pin
suriyakaqnnan25-Sep-12 19:09
suriyakaqnnan25-Sep-12 19:09 
AnswerRe: dateformat Pin
Sandeep Mewara25-Sep-12 20:25
mveSandeep Mewara25-Sep-12 20:25 
GeneralRe: dateformat Pin
suriyakaqnnan25-Sep-12 20:46
suriyakaqnnan25-Sep-12 20:46 
GeneralRe: dateformat Pin
Sandeep Mewara25-Sep-12 20:52
mveSandeep Mewara25-Sep-12 20:52 
GeneralRe: dateformat Pin
Albarhami26-Sep-12 20:39
Albarhami26-Sep-12 20:39 
GeneralRe: dateformat Pin
KiranKumar Roy14-Oct-12 3:07
KiranKumar Roy14-Oct-12 3:07 
AnswerRe: dateformat Pin
Albarhami25-Sep-12 23:18
Albarhami25-Sep-12 23:18 
Questionlogin Pin
suriyakaqnnan25-Sep-12 19:06
suriyakaqnnan25-Sep-12 19:06 
AnswerRe: login Pin
Sandeep Mewara25-Sep-12 20:29
mveSandeep Mewara25-Sep-12 20:29 
AnswerRe: login Pin
gopal pradhan8-Nov-12 23:21
gopal pradhan8-Nov-12 23:21 
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 

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.