[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Sending and Receiving Dataset

Lord2702

8/28/2004 12:44:00 AM

Fri. Aug. 27, 2004 5:25 PM PT

I have a remoting server as a console application, which host a COM+
Business Object Component(BOC). In this BOC I have two methods,
DataSet *ds GetCustomers();
// returns customers from NorthWind Database
DataSet *ds SubmitDataset(DataSet *ds, String *strTableName); //
submit the dataset and returns it back.although I don't want it to return

When I use these commands in my form, which is a typical dataentry form
which also displays records for browse. Now when I receive the DataSet with
GetCustomers() command I Bind controls, i.e. all the edit boxes. when user
clicks on EDIT button I allow them to change, and then on CONFIRM button I
submit the changes with BOC command SubmitChanges.

when I do two submissions, i.e. change one record, submit it, and then
browse for some records and then add record, and then submit it. I get
either, concurrency exception, or record will not be added. If I move this
model on just a plain form w/o. BOC, then everything works fine. Second
Confirm just works OK.

My Confirm function: two different forms
1: I took this Update from MSDN: Walkthrough: Creating a Distributed
Application. Which is using Web Service instead Remoting with COM+ object.
Confirm() {
DataSet *dsChanged = new DataSet(S"DSChanged");

dsChanged->Merge( ds->GetChanges() ); //ds is
original dataset
dsChanged = BOC->SubmitChanges(dsChanged, S"Cust");
ds->Merge( dsChanged );
}

2: // I expect to write the confirm like this. w/o return of dataset
Confirm() {
ds = BOC->SubmitChanges(ds, S"Cust");
}
Now if I submit one change and re-read the records with BOC->GetCustomers(),
and re-bind all the text boxes, it works fine, because everytime it receives
the fresh DS. This solution is OK, but not acceptable, as I don't want to
re-read the records.

Question: When I submit the changes, first time, it is OK, but why it is not
taking second change with the same line of code. ? Operation could be
anything, like first edit, then add, or first add then edit.

Thank you very much for reading such a descriptive message.