I am trying to write a routine that reads from 2 files and performs some analysis on the record, than writes the results to a seperate table. This should be very basic, but I am getting an error that there is already an open datareader associated with the command which must be closed.

here's my code

VB Code:
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.  
  6.             SqlConnection conn = new SqlConnection("server=JXXX;database =database;user id=sa5; password=XXXX");
  7.             SqlCommand comm = new SqlCommand("select site.siteid,RawDataInput.loc from site,RawDataInput where RawDataInput.CALC_SITEID=site.siteid", conn);
  8.             comm.Connection.Open();
  9.  
  10.             SqlDataReader r = comm.ExecuteReader(CommandBehavior.CloseConnection);
  11.             SqlCommand cmdnew = new SqlCommand("sudhir", conn);
  12.  
  13.             if (r.Read())
  14.             {
  15.                 Console.WriteLine(r["siteid"].ToString());
  16.  
  17.                 cmdnew.CommandText = "insert into sitecontroldata (siteid,location) values ('" + Function.ToInt(r["siteid"]) + "','" + r["loc"].ToString() + "')";
  18.                 cmdnew.ExecuteNonQuery();
  19.  
  20.                 for (int i = 0; i <= 10; i++)
  21.                 {
  22.                     cmdnew.CommandText = "insert into sitecontroldata (siteid,location) values ('" + Function.ToInt(r["siteid"]) + "','" + r["loc"].ToString() + "')";
  23.                     cmdnew.ExecuteNonQuery();
  24.                     Console.WriteLine("Record inserted" + r["siteid"].ToString());
  25.                 }
  26.             }
  27.         }
  28.     }

any ideas?