在访问mysql数据库时,如果在连接字符串中设置使用连接池,同时设置连接池大小,经测试,可以显著提高访问数据库时的速度。

连接字符串:

connectionStrings>
    <add name="connectionstr" connectionString="Database=userDB;Data Source=localhost;User Id=root;Password=abcabc;CharSet=utf8;port=3306;Pooling=true;Max Pool Size=100;"/>
</connectionStrings>

红色字体需要注意:声明在连接数据库时,使用连接池,同时设置连接池大小为100.

 

posted on 2015-06-04 17:52  踏歌&而行  阅读(3095)  评论(0编辑  收藏  举报