问题描述
publicstaticobjectGetSingle(stringSQLString){using(SqlConnectionconnection=newSqlConnection(connectionString)){using(SqlCommandcmd=newSqlCommand(SQLString,connection)){看上去好像每执行一条sql语句都会建立一次连接,这样子会不会太慢了大家也这么用吗?
时间: 2025-01-30 07:52:01
publicstaticobjectGetSingle(stringSQLString){using(SqlConnectionconnection=newSqlConnection(connectionString)){using(SqlCommandcmd=newSqlCommand(SQLString,connection)){看上去好像每执行一条sql语句都会建立一次连接,这样子会不会太慢了大家也这么用吗?