Click here to Skip to main content
13,445,690 members (36,959 online)
Rate this:
Please Sign up or sign in to vote.
i have two tables tableA tableB
in tableA i have

ID (int)

in tableB i have (ID foriegn key)

ID (int)
Bid (int)

my question is i have to get all values from tableB
in which i have only value in hand is "active"

in tableA
active field values are 1
ID values are different say 1,2,3,4,5

in tableB
ID vales are 1,2,3,4,5
Bid values are 6,7,8,9

i have to get all values (Addree from tableB) using active
how can i pass these values to array to get the values of tableB
Posted 13-Dec-12 17:58pm
Master Black 14-Dec-12 0:16am
Can you specify if there is any relation between your tables?
sreeCoderMan 14-Dec-12 0:18am
yes you can see ID in both tables

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

you can use simple SQL Join queries to retrieve the data from the database and fill your array.

select * from tableB B right join tableA A on B.Id = A.Id where = 1

more example on SQL Join Queries[^][^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04-2016 | 2.8.180314.2 | Last Updated 14 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100