Link to home
Start Free TrialLog in
Avatar of kreylor
kreylor

asked on

How do I get the updates that another user performed when using datasets in vb.net?

Hello Experts,

I have been programming with vs.net since 2003 and have never really figured out how to do this. I have done numerous searches and have come up with nothing.

What I am trying to accomplish is this:
User A opens the application and connects to the database to fill the datasets.
User B opens the application and connects to the database to fill the datasets.

User A is viewing the information.
User B updates some records.

I want User A to see the updated information that User B made. How can this be accomplished?
Avatar of ladarling
ladarling
Flag of United States of America image

If they are both working with datasets, the updates would not be available from the datasource until the changes to the datatables have been committed back to the datasource.
User A would need to execute, for example:
myDataSetTableAdapter.Update(myDataSource)

And then User B would need to refill their dataset, such as:
myDataSetTableAdapter.Fill(myDataSource)
Actually, from your example, the users would do that the other way round, but you get what I saying :-)
ASKER CERTIFIED SOLUTION
Avatar of elimesika
elimesika
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kreylor
kreylor

ASKER

I see what you are saying, but there are a few reasons not to do this.

This first reason is that if you have a lot of records, ex. 10,000, then it would take a very long time to refill. The second reason is that if User A is on, let's say, row 215. Once you refill the dataset then the user is kicked back to row 1. As you can tell, I have already tried this.

Is there any other solution on how to do this without using datasets? Is there a such thing as a user shared dataset? What I want is the ablility to move back and forth through the records and I don't think a datareader will work.
Avatar of kreylor

ASKER

That was fantastic Elimesika. This is exactly what I was looking for!