we have a appplication say Order Entry
which requires a dataset "order" contains
two table ordermas,ordertrans,orderdelivery
i am binding the ordertrans table to datagrid
i am binging the orderdelivery table to another datagrid
i m having a BL Class OrderBL
which will take this dataset for the operations.
once the user enters information in the screen
and fills two datagrids and send the dataset to BL where it is remoted
i m reading the dataset in DA class and saving the data to database using
insert statements all working fine.
Here comes the problem
Now the screen is still in edit mode, so i will put another entry in orderdelivery grid, when i try to save the record, exception thrown at the place, while we retrive the values from dataset against grid rows in grid there are two rows but in the dataset it is 1 row we entered previously.
This is the problem
If any of my sentence is not clear please reply
i belive some of the existing users might have implemented remoting with sycnfusion grids
Where is the exception being thrown? In the grid, your form, or your business or data class?
ADAdministrator Syncfusion Team October 6, 2003 11:24 PM
Thanks for your reply.
Please explain me further.
this is the code at client we face the exception,
Private Sub LoadDealCostFromScreen()
Dim costRow As DataRow()
Dim intCount As Integer
'In Cost Grid set UOMID to NULL if FLAT is selected and DELETE if cost_id is empty/null
For intCount = 1 To tpecost.gceCost.Model.RowCount - 1
costRow = ds.Deal_cost.Select("sequence_no = '" & tpecost.gceCost.Model(intCount, COS_SEQUENCE_NO).Text & "'")
If costRow(0).Item("cost_id") Is System.DBNull.Value OrElse Trim(CType(costRow(0).Item("cost_id"), String)) = "" Then
If Not costRow(0).Item("UOM_ID") Is System.DBNull.Value Then
If Trim(CType(costRow(0).Item("UOM_ID"), String)) = "" Then
costRow(0).Item("UOM_ID") = System.DBNull.Value
--->If costRow(0).Item............ this row
i get the exception since the dataset sequence numbers doesnot match with grid's model sequence numbers, it means that the grid's model not getting refreshed when we remote the dataset bound with grid simultaneously when we send the dataset to remote class as ByRef parameter.
THThomasOctober 7, 2003 09:08 AM
It doesn't matter if you send the DataSet ByRef because it inherits from MarshalByValue. That means that the dataset will be copied to the remoting server.
What we do is:
- use DataSet.GetChanges() to get the changed rows
- return the updated data to the client
- merge the updated data to the original dataset
Don't forget to cleanup any inserted data if the ID will be changed by database(IDENTITY in SQLSERVER), because these rows are still in your local dataset.
Hope this helps
ADAdministrator Syncfusion Team October 7, 2003 08:56 PM
I got your angle, it makes me more clear.
But the real problem is the dataset we are sending to remoting server as Byref got reflected the changes in the client.
But the grid attached is not getting refreshed is the main problem.
Can you help me now?
THThomasOctober 8, 2003 12:15 AM
Please send me more details, some source code which shows where you send the DataSet to the server and the server method itselft. Do you use SAO or CAO(server or client activated objects)?
We use remoting too and we try the approach to send only the changed data over the wire and merge the result to the local DataSet. You have to know that all data of the MarshalByValue object will be serialized, also the values of the instance variables. Why I should send unused data to the server? If you have 50 DataRows in a DataSet and you modify only 2 rows, it's not a good practise to send the whole dataset to the server.
The next point is to use stream compression and the binary formatter, otherwise the amount of data is to high. All this things are briefly described in book of Ingo Rammer.
Tip: the book Advanced .NET Remoting from Ingo Rammer is a good source for questions around remoting. ISBN is 1-59059-025-2
ADAdministrator Syncfusion Team October 8, 2003 02:44 AM
thanks once again, you are taking more steps to make me understand the situation.
i m just trying remoting with a sample 1 row in a grid, let us assume we always send 1 row to database, I am successful with remoting now.
i got the data back from remoting server.
since i bind the dataset with sync grid, i expected that the changes we have done in dataset
will reflect in grid too, but not exactly.
regarding remoting recommendations, i agree with everything info rammer consulting website says.
since i am just testing a sample.
i want my problem could be solved easily, i.e
dataset changes should reflect in the grid.model(row,col).text access..