G
Guest
Hi C# experts,
I am to C# and .NET.
I am writing a database application using C# and Dataset. In Sql server, I
have a Acount table which contains over 100,000 records. This table will be
accessed and updated by many users at same time. So the data in this table
keeps changing and growning.
I want to keep each user's local Dataset updated every time he does a update
or does a query. My code is like this:
myDataAdapter.update(myDataset, "Account");
//empty all the tables in myDataset
myDataset.clear();
myDataAdapter.fill(myDataset, "Account"); // fill in 100,000 records.
//myDataAdapter fills other tables.
Now I have two problems:
1. It is too slow. It takes a fows minutes to fill the database. So every
time, user changes data and updates, system hangs. User cannot bear it.
Question: how to fill in only the new records modified records in SQL server
to local dataset?
2. In the application, I have datagrid and other controls to represent data.
Every time when I refill the dataset, the cursor position is changed.
Question: How to keep the cursor at same position at same place after
refilling? Because I have many controls for different tables, it is not a
good option to first remember all the curser positions and go back after
refilling.
Thanks,
I am to C# and .NET.
I am writing a database application using C# and Dataset. In Sql server, I
have a Acount table which contains over 100,000 records. This table will be
accessed and updated by many users at same time. So the data in this table
keeps changing and growning.
I want to keep each user's local Dataset updated every time he does a update
or does a query. My code is like this:
myDataAdapter.update(myDataset, "Account");
//empty all the tables in myDataset
myDataset.clear();
myDataAdapter.fill(myDataset, "Account"); // fill in 100,000 records.
//myDataAdapter fills other tables.
Now I have two problems:
1. It is too slow. It takes a fows minutes to fill the database. So every
time, user changes data and updates, system hangs. User cannot bear it.
Question: how to fill in only the new records modified records in SQL server
to local dataset?
2. In the application, I have datagrid and other controls to represent data.
Every time when I refill the dataset, the cursor position is changed.
Question: How to keep the cursor at same position at same place after
refilling? Because I have many controls for different tables, it is not a
good option to first remember all the curser positions and go back after
refilling.
Thanks,