[MSSQL]TRY…CATCH…通用格式
作者:freethy 发布于:2015-6-25 10:39 Thursday
这一篇很简单,看代码:
USE Dorben
GO
BEGIN TRY
-- Generate a divide-by-zero error.
SELECT 1/0;
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() AS ErrorNumber,
ERROR_SEVERITY() AS ErrorSeverity,
ERROR_STATE() AS ErrorState,
ERROR_PROCEDURE() AS ErrorProcedure,
ERROR_LINE() AS ErrorLine,
ERROR_MESSAGE() AS ErrorMessage;
END CATCH
从 IClassFactory 为 CLSID 为 {AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2} 的 COM
作者:freethy 发布于:2015-6-25 10:15 Thursday
从ICassFactory为CLSID为{17BCA6E8-A950-497E-B2F9-AF6AA475916F}的COM组件创建实例失败,原因是呈现以下错误:c001f011.(Microsoft.Server.manageDTS)
今天在“新建保护规划”时,报错:
创建保护规划失败。 其他信息: 从 ICLassFactory 为CLSID为{17BCA6E8-A95D-497E-B2F9-AF6AA475916F}的COM组件创建实例失败,原因是呈现今后错误: c001f011.(Microsoft.SqlServer.ManagedDTS) 从ICassFactory为CLSID为{17BCA6E8-A950-497E-B2F9-AF6AA475916F}的COM组件创建实例失败,原 因是呈现以下错误: c001f011.(Microsoft.Server.manageDTS)
解决办法:
(x86) c:\windows\system32\regsvr32 "C:\Program Files\Microsoft SQL Server\(版本号)\DTS\Binn\dts.dll"(x64) c:\windows\syswow64\regsvr32 "C:\Program Files (x86)\Microsoft SQL Server\(版本号)\DTS\Binn\dts.dll"
然后重启启动 Microsoft SQL Server Management Studio
禁止IE兼容模式
作者:freethy 发布于:2015-6-22 15:18 Monday
<metahttp- equiv="X-UA-Compatible"content="IE=8"><!--以IE8模式渲染-->
<metahttp-equiv="X-UA-Compatible"content="IE=7"><!--以IE7模式渲染-->
还有一种情况, 在IE8下只有不使用兼容模式页面才能显示正常,但是如果设定为IE8的模式,在IE9中却会导致CSS3失效。看来,需要针对 IE8、IE9 分别 禁用兼容模式。怎么办呢?可以在后台判断浏览器版本,如果是IE8就输出content="IE=8",如果是IE9就输出 content="IE=9"。其实还可以单纯通过HTML来实现的,HTML代码如下:
<meta http-equiv="X-UA-Compatible"content="IE=9; IE=8; IE=7; IE=EDGE">
经测试后完美解决了兼容模式问题,这样设置后IE中设置兼容模式的按钮也会消失,可以按F12打开“开发人员工具”来检查浏览器模式。
IContainerProviderAccessor.ContainerProvider returned null, which is invalid. If the container provider belongs to the HttpApplication subclass, ensure that it is a static variable.
作者:freethy 发布于:2015-6-21 21:54 Sunday
IContainerProviderAccessor.ContainerProvider returned null, which is invalid. If the container provider belongs to the HttpApplication subclass, ensure that it is a static variable.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: IContainerProviderAccessor.ContainerProvider returned null, which is invalid. If the container provider belongs to the HttpApplication subclass, ensure that it is a static variable.
-------------------------------------------------------------------
此错误解决方案:安装补丁KB2468871即可解决!!!
DevExpress GridControl List绑定方式下新增行的方法
作者:freethy 发布于:2015-6-13 15:30 Saturday
List<Person> gridDataList = new List<Person>(); //此处是数据源 List集合 BindingList<Person> list = new BindingList<Person>(gridDataList); // 将List转换为BindList gridControl.DataSource = list ; // 将BindList 绑定到GridView
//新建一行 gridView1.AddNewRow(); //如果直接绑定 本方法将无效, 只有绑定方式为 DataSet DataTable 和 BindList 才能触发此函数效果.
//还有一种方式 BindingSource bdSource = new BindingSource(); bdSource.DataSource = gridDataList; gridControl.DataSource = bdSource;//此种方式 也能调用GridView自身的新增 AddNewRow 函数