Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: DBgrid or stringgrid to Database



Permlink Replies: 1 - Last Post: Sep 16, 2015 6:21 AM Last Post By: Robert Triest
Ferhat Ergin Tu...

Posts: 16
Registered: 7/17/15
DBgrid or stringgrid to Database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 16, 2015 5:17 AM
how can i delete a row and column from stringgrid?

and also i want to save stringgrid to access database (block save like all info from grid)

thnaks
Robert Triest

Posts: 687
Registered: 3/24/05
Re: DBgrid or stringgrid to Database
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 16, 2015 6:21 AM   in response to: Ferhat Ergin Tu... in response to: Ferhat Ergin Tu...
DBGrid and Stringgrid are different Grids, so the answers are very different.

Database - TQuery - DataSource - DBGrid.
Database - TQuery - TQuery First...Next until eof - Draw Stringgrid.

For row delete, you need to delete the source data and repopulate the Grids. Refresh (DBGrid) or redraw (Stringgrid)
If you want to dump your data from a Stringgrid into a Database then you have to loop through
your Stringgrid rows and cols and write your own SQL dump procedure. (INSERT INTO)

In a DBGrid you can add the cols you want to display. DBGrid has a Columns property.
In runtime you can delete one of these cols. Nothing will be deleted from your database.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02