[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Is there a easy way to refresh the Linq to sql

Asked by GordonLiq in Language Integrated Query - LINQ

Tags: linq sql

Hi  ,
I have a DataGrid bind to Linq   like DataContextA.TableA
and I do add a new record or modify the record at a popup windows and update the DB using
DataContextB.

It is really hard for me to get the new or modified record,
and I have to using different code to get the updated or new record.
that is really annoying ,
is there an easy way to get the updated or new record that changed in another DataContext.

For some reason , I cannot put the DataContextA as a parameter to popup windows and change the DB with DataContextA .  

so the scenoria must be
one DataContext to change the DB
one Datacontext to get the changed DB.
1:
2:
3:
4:
5:
6:
Code to get the modified record
DataContextA.Refresh(RefreshMode.OverwriteCurrentValues, DataContextA.TableA); 
Code to get the new record:
bindingSource1.DataSource = from rs in DataContextA.TableA
                                        select rs;
[+][-]11/04/09 08:08 AM, ID: 25740731Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 04:32 PM, ID: 25745709Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/05/09 08:42 AM, ID: 25751278Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/05/09 02:00 PM, ID: 25754524Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 05:32 AM, ID: 25758873Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625