Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to show data in Tdbgrid

Status
Not open for further replies.

rizunb

Programmer
Feb 27, 2003
63
CA
Hello people
I am very new to delphi
i have sql server 200 and I am trying to make a select statement and show the result of that select statement into TDBGRID. now I am not sure how to do this. what i have on my form is

1) TDATABASE
2) TDATASOURCE
3) TQUERY

i am able to run the sql properly and show data into an edit box, but now I want to be able to show the result of an sql statement in a dbgrid.

I will appreciate if you can guide me how to do this. I have been looking for it on internet a lot but cant find a proper guide to it.

 
Place TDBGrid on the form

Set DataSource property to your existing TDataSource.

(Presumably you have the DataSource.Dataset set to TQuery)

Set Query active even at design time to see results.

It is beyond the answer to your question, but as you are new:
The BDE (TDataset and TQuery) is depreciated, meaning no recommended for new applications. With SQL Server I suggest you replace the TDatabase with a TADOConnection and the TQuery with a TADODataset and learn with them instead.

Have fun
Simon

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top