I am seeing something weird my .Net Web application.
The below is my code
SqlConnection myConn = new SqlConnection(@"Server=192.168.2.2;Initial Catalog=sss;User ID=dsd;Password=sdd"); SqlCommand myCommand = new SqlCommand("select * from sss.ALARM", myConn); SqlDataReader dataReader; try { myConn.Open(); dataReader = myCommand.ExecuteReader(); GridView1.DataSource = dataReader; GridView1.DataBind(); dataReader.Close(); myCommand.Dispose(); myConn.Close(); } catch (System.Exception ex) { Response.Write(ex.ToString()); }
While this application get attached to my .Net profiler that have set Jit Compilation event mask, I am getting two "System.Data.SqlClient.SqlCommand:ExecuteReader" calls in JITCompilationStarted function.
But there is only one Executereader used. What is the reason for this ?
Thanks
-Selva