Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Table as follows
Faculty id(Table name faculty)

1
2
3
4
5
6
7
8
9
10

Then i have select query as follows
Select CourseName from Course where Faculty id = '4'

i want to store the Facultyid(Table faculty) using array and pass that array into above select statement.


for that how can i do using csharp.
Posted
Comments
Pradeep Shukla 25-Sep-13 22:55pm    
Why you want to pass the values (Faculty ID) as array, you can use IN operator and add a sub query that lists the Faculty ID. It would keep all this code at a single place in a stored proc.
[no name] 26-Sep-13 1:02am    
Actually what you are trying to say or trying to do?
I didn't get you so update or modify your question clearly.
OmniSource 26-Sep-13 3:38am    
Hi,

You may want to do inner join between your faculty and course table on your faculty_id column, if you already know how to retrieve your faculty_id's from faculty table. however if you are trying to send that array from managed code to SQL, then solution to your problem is a different game. so please elaborate your question as fellow friends have asked in comments above.
aboubkr90 26-Sep-13 17:02pm    
Are you trying to group courses by faculties?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900