|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Can i output combined query to DBGrid or DBEhlibGrid
Hello friends!
I need your help in this case. I've 2 tables: table1(id, id_bookname) and table2(id, id_bookname, bookname). table1's `id_bookname` consists table2's integer `id_bookname`'s values. Can i output combined query to DBGrid or DBEhlibGrid which contains table1's `id` and table2's `bookname`. For instanse, table1 id id_bookname ------------------------------ 1 134 2 532 3 134 4 134 5 532 table2 id id_bookname bookname ----------------------------------------------------- 1 134 book1 2 532 book2 Results in DBGrid must be: id bookname --------------------------- 1 book1 2 book2 3 book1 4 book1 5 book2 |
|
#2
|
||||
|
||||
|
Re: Can i output combined query to DBGrid or DBEhlibGrid
You can probably do a query such as this:
Code:
SELECT table1.id,table2.bookname FROM table1,table2 WHERE table1.id_bookname=table2.id_bookname |
|
#3
|
||||
|
||||
|
Are you Using SQL? Also are you trying to display the results in an ASP.Net Page using Visual Studios? or just in SQL, if using SQL.
If just in SQL the query by MattD should work. If in ASP.Net using visual studios, under the data category drag the sql data source into the design view, hover the mouse over the new control and select the arrow in the upper right corner, select configure data source, create the connection string, then click next. Next select custom query, then paste MattD's query into the feild. click next, finish Next on the design veiw drag the gridveiw onto the screen where u placed the last control. select the configure datasource as you did for the previous control, select datasource1, or create new if not there. That should be it. to veiw results, click veiw in browser in the menubar on the top of the page. ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calculus Query | phrontist | Math and Science | 36 | 01-11-2005 20:24 |
| Delhpi Program Query | sunil bansal | Programming | 4 | 04-02-2005 00:22 |
| Member Query | Tytus Gerrish | CD Forum Support | 9 | 02-12-2003 20:09 |
| MySQL query question | Jack | Website Design/Showcase | 9 | 02-02-2003 00:11 |
| Can I drill the output shafts of unmodifiable motors? | archiver | 2001 | 4 | 23-06-2002 23:08 |