connect to database using binding datagrid

G

Guest

I am connecting t mysql & sqlserver database using bindng data cntrs
inculding the datagrid but I feel it's too slow.. specially when adding a
record to a database and needs to refresh the datagrid where I have to refill
the dataset which is a waste of time for the user specially on a network.

what is the best & fastest way to connect and refresh controls?
 
G

Guest

This really depends on whether you are talking ASP.NET or WIndows Forms. For
Windows forms, you can cache the DataSet on the client and set up your own
updater on a different thread. This will, in most instances, keep you in sync.

With ASP.NET, it gets trickier, as ASP.NET is completely disconnected and
also paints in HTML, so the direct connection to data is not there. You can
cache the DataSet on the server, which will speed things up somewhat, but you
will still have to round trip.

You can cut some of this out by using XML and only rebinding part of the
form, but this will make a less maintainable system.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
I

Ilya Tumanov [MS]

You mean you're adding records directly to the database by executing some
query and refilling DataSet to show it?

If so, that's not the right way to do it. Instead add record(s) to the
DataSet and run DataAdapter.Update() as soon as you ready to update the
database.

This way you can do a bulk update and new/changed records will be shown in
the grid instantly.


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top