Example #1
0
 /// <summary>
 /// Check and create the IsMapServer column in Databases.mdb database
 /// </summary>
 private void CheckNCreateIsMapServerColumnInMDBDatabase()
 {
     DIConnection dIConnection = null;
     try
     {
         dIConnection = new DIConnection(DIServerType.MsAccess, string.Empty, string.Empty, Server.MapPath("../../stock/Database.mdb"),
                          string.Empty, string.Empty);
         try
         {
             DataTable table = dIConnection.GetConnection().GetSchema("Columns");
             var v = from r in table.AsEnumerable() where (r["TABLE_NAME"].ToString() == "MappingInformation" && r["COLUMN_NAME"].ToString() == "mapserver_used") select r;
             if (v.Count() == 0)
             {
                 dIConnection.AddColumn("mappinginformation", "mapserver_used", "Text", "False");
             }
         }
         catch
         {
         }
     }
     catch (Exception ex)
     {
         Global.WriteErrorsInLogFolder("error in Registering new database");
         Global.CreateExceptionString(ex, null);
     }
     finally
     {
         if (dIConnection != null)
         {
             dIConnection.Dispose();
             dIConnection = null;
         }
     }
 }