public Save ( string connectionString ) : bool | ||
connectionString | string | |
return | bool |
internal static void UpdateDatabaseMetaProperty(string connectionString, string propertyName, string propertyValue) { System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(); try { var settings = new nHydrateSetting(); settings.Load(connectionString); switch (propertyName) { case "dbVersion": settings.dbVersion = propertyValue; break; case "LastUpdate": settings.LastUpdate = DateTime.Parse(propertyValue); break; case "ModelKey": settings.ModelKey = new Guid(propertyValue); break; case "History": settings.LoadHistory(propertyValue); break; default: throw new Exception("No property found!"); } settings.Save(connectionString); } catch (Exception ex) { throw; } finally { if (conn != null) conn.Close(); } //We no longer use extended properties if (CanUseExtendedProperty(connectionString)) { if (ExtendedPropertyExists(connectionString, propertyName, string.Empty, string.Empty, string.Empty)) { //UpdateExtendedProperty(connectionString, propertyName, propertyValue, string.Empty, string.Empty, string.Empty); DeleteExtendedProperty(connectionString, propertyName); } else { //InsertExtendedPropery(connectionString, propertyName, propertyValue, string.Empty, string.Empty, string.Empty); } } }