当前位置:编程学习 > C#/ASP.NET >>

asp.net 连接数据库问题

穿上空间的代码过段时间就会出现这个问题

Server Error in '/' Application.
--------------------------------------------------------------------------------

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

把数据库的日志文件删除了,又好了,过段时间又会报

请问这么解决?数据库 MSSQL
答案:
在web.config中有这么一句:connectionString="Data Source=CGZ;Initial Catalog=kms;User id=sa;pwd=;Connect Timeout=60;你的问题可能是没有Connect Timeout=60;
那是因为你没有编译连接数据库的语言   你试下这个代码可以吗!
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "server=(local);database=;uid=sa;pwd=;";
conn.Open();
This may have occurred because all pooled connections were in use and max pool size was reached. 

max pool size was reached.好像是说你的池子满了,你数据库创建的时候是不是限制了MAX的哦,所以数据库满了,就插不进去数据了

上一个:如何利用ASP实现这个效果?
下一个:asp.net 会员注册CheckBox问题。

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,