日期:2014-05-17 浏览次数:20584 次
Stored Procedure
--------------------------
CREATE PROCEDURE spParameterBug @myText Text AS
Insert Into ParameterBugTable (TextField) Values (@myText)
Code
-------
static void Main(string[] args)
{
string dummyText=string.Empty;
for (int n=0; n < /*80*/ 3277; n++) // change this to 80 to receive the second error that is mentioned earlier in this article.
{
dummyText += "0123456789";
}
// TO DO: Change data source to match your SQL Server:
SqlConnection con= new SqlConnection("data source=myserver;Initial Catalog=mydb;Integrated Security=SSPI;persist security info=True;packet size=16384");
SqlCommand cmd = new SqlCommand("SpParameterBug", con);
con.Open();
// Causes error 17805:
SqlParameter param2 =new SqlParameter("@myText", dummyText);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(param2);
try
{
cmd.ExecuteNonQuery();
}
catch (Exception err)
{
Console.WriteLine(err.ToString());
}
Console.ReadLine();
}
------解决方案--------------------
很有可能是因为连接没有及时释放,
网站最后挂掉时报的什么错误?
2000有没有打最新的补丁呢?
------解决方案--------------------
完蛋了...
------解决方案--------------------
连接没关闭?
------解决方案--------------------
绑定一下
------解决方案--------------------
用一楼的吧,要不就及时关闭连接。
------解决方案--------------------
把网站的应用池程序配置一下(在IIS站点目录下面,找到你的网站使用的应用池,然后配置),当应用池程序占用的资源大于多少的时候,让程序重新启动,就不会挂了
------解决方案--------------------
using(//这里是创建链接数据库或“稀缺资源”的实例的地方)
{}
采用这样的方式,能及时关闭连接,释放资源
------解决方案--------------------
我乃菜鸟,只好帮你顶