Autor Beitrag
lemmond1976
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 66



BeitragVerfasst: Sa 10.05.03 20:32 
Hallo,

meine dbgrid zeigt eine bestimmte Tabelle meines sql servers an.
Allerdings möchte ich auch noch eigene Spalten hinzufügen ?
Wie kann ich das am besten machen ?

Danke !


Gruss
Gunnar
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: So 11.05.03 09:14 
Soll das eine Spalte sein, die sich aus anderen Spalten der Tabelle zusammensetzt ? Wenn ja, kannst Du das in dem SQL-Befehl SELECT machen.

Beispiel :
ausblenden Quelltext
1:
SELECT Feld 2, feld 3, feld 4,count(feld1) AS Test1 FROM Tabelle					


Im DBGrid werden dann die Spaltentitel --> xxx,xxx,xxx,Test1 angezeigt. Wobei die xxx immer den Namen des Feld2-4 tragen.
lemmond1976 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 66



BeitragVerfasst: So 11.05.03 10:44 
hi, ja wäre eine Idee, es reichte allerdings, daß ich die dbgrid mit der DataSource Komponente verbunden habe. Somit wird die entsprechende Tabelle angezeigt. Nun muß ich allerdings noch Felder aus einer anderen Tabelle hinzufügen. Das geht ja über den Select-Befehl.
Wie baue ich diesen denn ein ?
Danke !

Gruss
Gunnar
lemmond1976 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 66



BeitragVerfasst: So 11.05.03 13:01 
alles klar, es läuft