SQL Server - How to write selected stored procedure

Asked By bhanupratap singh on 20-Nov-12 05:11 AM
I want to write Select stored procedure . But problem is that I need to select data from table which has parameter one .
           
Suppose user selects multiple value in listbox, like:-
Delhi
Mumbai
Kolkata

Then I need to fetch data from table which have user selected. I need this data  in single row to bind the datatable

like
Delhi= 5 students totalfees=5000          
Mumbai= 50 students totalfees=15000

Robbe Morris replied to bhanupratap singh on 20-Nov-12 07:57 AM
If you have SQL Server 2008 or above, you could use table parameters:

http://lennilobel.wordpress.com/2009/07/29/sql-server-2008-table-valued-parameters-and-c-custom-iterators-a-match-made-in-heaven/