数据库超时异常怎么捕捉 数据库超时异常怎么捕捉 SQL2005 数据库,执行SQL语句时间过长,超过了设定的时间, 系统自动弹出超时错误, 我想捕捉到这个超时的异常,然后提示自定的异常页面,怎么能实现呀? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 try{ //数据库操作}catch(Exception ex){ messbox.show(ex.message)} try { //数据库操作 } catch(Exception ex) { MessageBox.Show(ex.message) }正解你可以把 楼主说的是SQL里的吧,追踪一下. try {} catch(System.Exception ee) { response.redirect("<script language=javascript>alter("+ee.Message.ToString()+")</script>) } SqlConnection sql= new SqlConnection (ConfigurationManager .AppSettings ("XXX")); SqlCommand CMD=new SqlCommand ("sql语句",sql); try { sql.Open (); //SQL } catch(System.Exception ee) { response.redirect("<script language=javascript>alter("+ee.Message.ToString()+")</script>"); } mspropshell控件的问题!! 添加文本数据,,,望高手快点帮忙阿,都2-3天了 gridview上右键单击可以实现下拉菜单功能吗?用c#实现 急求 数据库连接不上,大家来帮看看!!先谢谢了! C#打印问题:在打印预览里面正常,但点击预览里面得打印后,在纸上只打印出来了一部分 初学ado.net,请教一个问题 看过《C#入门经典》的进来说说。 通过WebService连接SQL 数据库的问题 问大家一个数据库读取的问题! 高分儿!(急) 关于vs2005中Microsoft Agent的问题 关于做OA方面的书,我用的是c#和.net
{
//数据库操作
}
catch(Exception ex)
{
messbox.show(ex.message)
}
{
//数据库操作
}
catch(Exception ex)
{
MessageBox.Show(ex.message)
}正解你可以把
try
{}
catch(System.Exception ee)
{
response.redirect("<script language=javascript>alter("+ee.Message.ToString()+")</script>)
}
SqlConnection sql= new SqlConnection (ConfigurationManager .AppSettings ("XXX"));
SqlCommand CMD=new SqlCommand ("sql语句",sql);
try
{
sql.Open ();
//SQL
}
catch(System.Exception ee)
{
response.redirect("<script language=javascript>alter("+ee.Message.ToString()+")</script>");
}