Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql via .net selecting conditionally from 2 tables

Author  Topic 

rbanay
Starting Member

1 Post

Posted - 2012-05-22 : 15:41:08
hi all . this is my first sql question (my first post) and my first .net project
there is a table which holds all user info with custid,name and some more unrelevent coulumns, and another one that holds name,userid timein, timeout, date... (As a a "timeClock" for the salary calcuations)
real parameters:
(TABLE1) --> user's "name", "custId" and more.... tblname is: [tblCustomers]
(TABLE2) --> user's "name", "timeIn", "timeOut", "DATE", "UserId",tId ... tblname is:[tblTime]
table1 PK is custId
table2 PK is tId

i am trying to query table2
with a dropdownlist that is bound to the table1 "name"
i get the list of users (can see it in drdownlist) if i do query : SELECT name, custId FROM tblCustomers WHERE custType = 6 -->(that is the tblcustomers <custType's value 6> = the "workers kind" records... that are relevent in tblTime)

i get a list of name and custId from table1 that needs to triger the select query on table2 that will select all columns from table2 via selected custId of table1 via dropdownlist that is bound to name coulumn in table1 .
i will try to load a picture

thanks in advance

Robbie.b
   

- Advertisement -