SqlConnection链接字符串的问题
我有一个数据库访问类:
public class SqlHelper
{
private static SqlConnection connection = null;
private static String conString = "server=192.168.0.1;User ID=sa;Password=;database=HrSysTool;Connection Reset=FALSE ";
public static SqlConnection Connection
{
get
{
if (connection == null)
{
//重新创建
connection = SqlHelper.ConnectionDB();
}
if (connection != null && connection.State == ConnectionState.Closed)
{
//重新连接
connection.Open();
}
return connection;
}
}
public static SqlConnection ConnectionDB()
{
SqlConnection conn = null;
try
{
conn = new SqlConnection(conString);
&