But why you need temp table at SQL server side..
1) if you wish to perform operation on C# side just take data in DATASET
instead of DATAREADER
.. and
DataSet dataset = new DataSet();
using (SqlConnection conn = new SqlConnection(connString))
{
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand("select * from tableA", conn);
conn.Open();
adapter.Fill(dataset);
conn.Close();
foreach (DataRow row in dataset.Tables[0]) // Loop over the rows.
{
// perform your operation
}
}
2) if you need to perform operation on SQL side then create a stored procedure
at SQL server .. in the stored procedure create #table
and use it ..
3) and you do not want to create DATASET
then you can take data LIST
and perform your operation on C# side