当前位置: 首页>>代码示例>>C#>>正文


C# SqlCeEngine.Repair方法代码示例

本文整理汇总了C#中SqlCeEngine.Repair方法的典型用法代码示例。如果您正苦于以下问题:C# SqlCeEngine.Repair方法的具体用法?C# SqlCeEngine.Repair怎么用?C# SqlCeEngine.Repair使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlCeEngine的用法示例。


在下文中一共展示了SqlCeEngine.Repair方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RepairDatabaseRecoverAllPossibleRows

 public void RepairDatabaseRecoverAllPossibleRows(string connectionString)
 {
     using (SqlCeEngine engine = new SqlCeEngine(connectionString))
     {
         engine.Repair(connectionString, RepairOption.RecoverAllPossibleRows);
     }
 }
开发者ID:inickvel,项目名称:SqlCeToolbox,代码行数:7,代码来源:SqlCeHelper.cs

示例2: RepairDatabaseRecoverAllOrFail

 public void RepairDatabaseRecoverAllOrFail(string connectionString)
 {
     using (SqlCeEngine engine = new SqlCeEngine(connectionString))
     {
         engine.Repair(connectionString, RepairOption.RecoverAllOrFail);
     }
 }
开发者ID:inickvel,项目名称:SqlCeToolbox,代码行数:7,代码来源:SqlCeHelper.cs

示例3: RepairDatabaseDeleteCorruptedRows

 public void RepairDatabaseDeleteCorruptedRows(string connectionString)
 {
     using (SqlCeEngine engine = new SqlCeEngine(connectionString))
     {
         engine.Repair(connectionString, RepairOption.DeleteCorruptedRows);
     }
 }
开发者ID:inickvel,项目名称:SqlCeToolbox,代码行数:7,代码来源:SqlCeHelper.cs

示例4: Repair

        public ActionResult Repair()
        {
            var engine = new SqlCeEngine(ConfigurationManager.ConnectionStrings["FeedsDbEntities"].ConnectionString);

            // Specify null destination connection string for in-place repair
            engine.Repair(null, RepairOption.RecoverAllOrFail);

            return View();
        }
开发者ID:benmcevoy,项目名称:Rss,代码行数:9,代码来源:SystemController.cs

示例5: Repair

 /// <summary>
 /// Repairs a corrupted database. Call this method when <see cref="Verify"/> returns false. Applies only to SQL CE.
 /// </summary>
 internal static void Repair()
 {
     using (SqlCeEngine engine = new SqlCeEngine(Util.ConnectionString))
     {
         engine.Repair(null, RepairOption.RecoverAllPossibleRows);
     }
 }
开发者ID:xusun,项目名称:GalleryServerPro,代码行数:10,代码来源:DataUtility.cs

示例6: Repair

        /// <summary>
        /// Repairs a corrupted database. Call this method when <see cref="Verify"/> returns false.
        /// </summary>
        public void Repair()
        {
            using (var engine = new SqlCeEngine(ConnectionString))
            {
                engine.Repair(null, RepairOption.RecoverAllPossibleRows);
            }

            // Same thing using Reflection:
            //object sqlCeEngine = null;
            //try
            //{
            //	sqlCeEngine = SqlCeEngineType.InvokeMember(null, BindingFlags.CreateInstance, null, null, new object[] { ConnectionString });

            //	var repairOptionEnumType = SqlCeAssembly.GetType("System.Data.SqlServerCe.RepairOption");

            //	var repairOptionRecoverAll = repairOptionEnumType.GetField("RecoverAllPossibleRows").GetValue(repairOptionEnumType);

            //	SqlCeEngineType.InvokeMember("Repair", BindingFlags.InvokeMethod, null, sqlCeEngine, new[] { null, repairOptionRecoverAll });
            //}
            //catch (TargetInvocationException ex)
            //{
            //	AppEventController.LogError(ex.InnerException ?? ex);
            //	throw;
            //}
            //finally
            //{
            //	if (sqlCeEngine != null)
            //		SqlCeEngineType.InvokeMember("Dispose", BindingFlags.InvokeMethod, null, sqlCeEngine, null);
            //}
        }
开发者ID:Jiyuu,项目名称:galleryserverpro,代码行数:33,代码来源:SqlCeController.cs


注:本文中的SqlCeEngine.Repair方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。