Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Static Variables

$
0
0

As static variables are static for the whole web application, is it dangerous to declare sql specific variables as static :

public static class Database
{

public static SqlConnection Sql_Connection;
public static SqlCommand Sql_Command;
public static SqlDataReader Sql_DataReader;  etc....

}

Because FOR EXAMPLE: suppose 2 users might call SqlDataReader at the same time, the danger is that the result of one user might sent to the second one since the content (value) of the SqlDataReader is UNIQUE for the whole application.  is my assumption right?


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>