Here is a short code snippet to execute a query using ADO.Net
using(SqlConnection objSqlConnection = new SqlConnection(sConnectionString))
{
objSqlConnection.Open();
using (SqlCommand objSqlCommand = new SqlCommand(sSQLQuery, objSqlConnection))
{
objSqlCommand.ExecuteNonQuery();
}
}
Where 'sConnectionString' is a standard SQL Server connection string and 'sSQLQuery' is a basic INSERT query
While executing the above code in a loop (once in a second), I found something very strange.
Handle count of the application is kept on increasing per execution.
Am I missing something?
Any thoughts will be greatly appreciated.
There are other similar questions here. One of the answers was to change the target framework to 3.5. But in my case, it is not possible - my target is 4.0.