We help IT Professionals succeed at work.

dbgrid vs datagrid

santosh_14
santosh_14 asked
on
How is dbgrid and datagrid different?

What are the issues on each with bound and unbound mode?

Which is better for a client-server app over the LAN?

Thx
Comment
Watch Question

Éric MoreauSenior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016

Commented:
Not much differences. DBGrid was used in VB4 and VB5 with DAO and RDO. The DataGrid is to be used with ADO (coming with VB6).

Commented:
Speaking of client/server, the only way to go is the DataGrid and ADO. Using ADO, you can create disconnected recordsets for transfer between client and server (by using static client-side cursors and optimistic locking). You can then bind these recordsets to the grid control and have the contents of the recordset be displayed without a single line of code. By adding navigation controls and a couple of lines of code, you can even edit the recordset, add and delete rows, and the re-submit the recordset to the server, connect it to the database again and update the database in a batch.

If you are creating a true enterprise application, I would nonetheless go to the extra work of writing the code surrounding the grid manipulation myself as I have found data-binding a little flaky. It is a nice prototyping feature but nothing else, just as so much in VB.

There are pretty cool 3rd party grid controls around that will let you do much more, like using drop-downs, checkboxes, etc.

/Ola

Author

Commented:
Hey! I'd like to get a few more view points.

I also would like some response to this -

My data needs to basically be shown as a table (either like a list view or data grid). I want the user to be able to *select* the data in the cell and be able to copy the data via *CTRL-C* or *right-click-copy*

Also, in the *normal* way the data should be *uneditable*

Once the user clicks an *edit* button .. the data should become editable and I am willing to manage the update via *explicit* coding

Once the user clicks *insert* button .. I want a blank row to appear at the bottom and the user should be able to *input* data which later can be updated via my code.

I don't want to use data-bound control because I have heard its helluva problem!!!

Pls suggest a solution.

TIA

Author

Commented:
Hey! I'd like to get a few more view points.

I also would like some response to this -

My data needs to basically be shown as a table (either like a list view or data grid). I want the user
to be able to *select* the data in the cell and be able to copy the data via *CTRL-C* or *right-click-copy*

Also, in the *normal* way the data should be *uneditable*

Once the user clicks an *edit* button .. the data should become editable and I am willing to manage
the update via *explicit* coding

Once the user clicks *insert* button .. I want a blank row to appear at the bottom and the user should
be able to *input* data which later can be updated via my code.

I don't want to use data-bound control because I have heard its helluva problem!!!

Pls suggest a solution.

TIA
Senior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016
Commented:
Create a ADO disconnected recordset, fill it with your data, and bind a DataGrid control to your disconnected recordset. The user will be able to use the data without having going to the database. When the user click on your Save button, write code to update your database.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.