mark rows as deleted or updated befor loading them in a dataset
-
Hello, I'm developping a sync solution enables filtering but is there any way to load the changes form the source database into a dataset and mark the deleted or updated rows to transfer this dataset to client and update its data? I've tryied to use the Microsoft Sync Framework but it does not allow filtering even if I use a custom provider because in my scenariro I want to sync a subset of the data on the server with a client and vice versa sync framework depends on primary key only which not acceptable here because when deleting or updating rows these rows may deletetd for another user in the source database the primary key in the client will not be the same as the server this is because I want to select the changes as xml and populate the dataset soit can mark the deleted rows and updated .. ctc
Dad
-
Hello, I'm developping a sync solution enables filtering but is there any way to load the changes form the source database into a dataset and mark the deleted or updated rows to transfer this dataset to client and update its data? I've tryied to use the Microsoft Sync Framework but it does not allow filtering even if I use a custom provider because in my scenariro I want to sync a subset of the data on the server with a client and vice versa sync framework depends on primary key only which not acceptable here because when deleting or updating rows these rows may deletetd for another user in the source database the primary key in the client will not be the same as the server this is because I want to select the changes as xml and populate the dataset soit can mark the deleted rows and updated .. ctc
Dad
Normally in this situation there is a timestamp field, or some other type, in the database that is used to tell if a row has been updated. Add a where clause to your query to get the changed rows.
I know the language. I've read a book. - _Madmatt
-
Normally in this situation there is a timestamp field, or some other type, in the database that is used to tell if a row has been updated. Add a where clause to your query to get the changed rows.
I know the language. I've read a book. - _Madmatt
Yes I've done it but I want to transfer the data to the client as a dataset holding the changes so how I tell the dataset that certain row is deleted or inserted or updated when it reads the xml file and not aftr loading the data throw the rowstate property
Dad
-
Yes I've done it but I want to transfer the data to the client as a dataset holding the changes so how I tell the dataset that certain row is deleted or inserted or updated when it reads the xml file and not aftr loading the data throw the rowstate property
Dad
I don't understand what you are asking. You have all the tools, what is the problem you are having?
I know the language. I've read a book. - _Madmatt
-
I don't understand what you are asking. You have all the tools, what is the problem you are having?
I know the language. I've read a book. - _Madmatt
I select the modified data from the sql server as a xml I've added an attribute to each row to tell me its state when I load this file to a dataset it does not read the stated it marks all rows as Added by default so if I want to change the state I have to loop over the table and change the rowstate property my question is Can I change the state when the data set loads the xml file or I have to loop over the table after population?
Dad
-
I select the modified data from the sql server as a xml I've added an attribute to each row to tell me its state when I load this file to a dataset it does not read the stated it marks all rows as Added by default so if I want to change the state I have to loop over the table and change the rowstate property my question is Can I change the state when the data set loads the xml file or I have to loop over the table after population?
Dad
Why are you returning XML that is then placed into a dataset? :omg: This makes no sense at all. Its like converting an int to a string then back to an int. Add the column to the select query then it will be in the dataset already. Otherwise, no, there is no other way except to iterate through the rows.
I know the language. I've read a book. - _Madmatt
-
Why are you returning XML that is then placed into a dataset? :omg: This makes no sense at all. Its like converting an int to a string then back to an int. Add the column to the select query then it will be in the dataset already. Otherwise, no, there is no other way except to iterate through the rows.
I know the language. I've read a book. - _Madmatt
I've tried the xml to let me choose an intermediate method to tell the dataset the state of rows but it will be more efficient if it loads the data directly but If it does, also, How can I tell the row state? this data set will be transferred to a client where another adapter will update the client database so the dataset must tell the state of the rows which I cant do when loading the data because the column which tell the state is invented by my sql script and it does not belong to table so the data set will trait it as a normal column.
Dad
-
I've tried the xml to let me choose an intermediate method to tell the dataset the state of rows but it will be more efficient if it loads the data directly but If it does, also, How can I tell the row state? this data set will be transferred to a client where another adapter will update the client database so the dataset must tell the state of the rows which I cant do when loading the data because the column which tell the state is invented by my sql script and it does not belong to table so the data set will trait it as a normal column.
Dad
You are making this out to be much more difficult that it really is. This issue in particular and the entire architecture of your application from the sounds of it. If the client can call the database to update the records why are you placing this intermediary step in between, access from the client, or better yet from a properly constructed dta accsss layer.
hadad wrote:
invented by my sql script and it does not belong to table
YES it does. If it's in the select statement is will be in the dataset. RTFM!!
I know the language. I've read a book. - _Madmatt