public IColumn ProcessColumnNode(XmlNode node) { IColumn column = new Column(); ProcessScriptBase(column, node); /* * <Datatype>int</Datatype> * <Default /> * <InPrimaryKey>True</InPrimaryKey> * <IsCalculated>False</IsCalculated> * <IsComputed>False</IsComputed> * <IsIdentity>False</IsIdentity> * <IsNullable>False</IsNullable> * <IsReadOnly>False</IsReadOnly> * <IsUnique>True</IsUnique> * <OrdinalPosition>1</OrdinalPosition> * <Precision>10</Precision> * <Scale>0</Scale> * <Size>0</Size> */ NodeProcessor proc = new NodeProcessor(node); column.OriginalDataType = proc.GetString("Datatype"); column.Default = proc.GetString("Default"); column.InPrimaryKey = proc.GetBool("InPrimaryKey"); column.IsCalculated = proc.GetBool("IsCalculated"); column.IsComputed = proc.GetBool("IsComputed"); column.IsIdentity = proc.GetBool("IsIdentity"); column.IsNullable = proc.GetBool("IsNullable"); column.IsReadOnly = proc.GetBool("IsReadOnly"); column.IsUnique = proc.GetBool("IsUnique"); column.OrdinalPosition = proc.GetInt("OrdinalPosition"); column.Precision = proc.GetInt("Precision"); column.Scale = proc.GetInt("Scale"); column.Size = proc.GetLong("Size"); return(column); }
private ConnectionStringHelper LoadGenericDatabaseData(XmlNode node, DatabaseTypes databaseType) { NodeProcessor proc = new NodeProcessor(node); var connectionHelper = new ConnectionStringHelper(); if (string.IsNullOrEmpty(connectionHelper.ServerName)) { switch (databaseType) { case DatabaseTypes.SQLCE: //case DatabaseTypes.SQLServer2000: case DatabaseTypes.SQLServer2005: connectionHelper.ServerName = Environment.MachineName; break; case DatabaseTypes.SQLServerExpress: connectionHelper.ServerName = Environment.MachineName + "\\SQLEXPRESS"; break; case DatabaseTypes.MySQL: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.Oracle: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.PostgreSQL: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.Firebird: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.SQLite: connectionHelper.ServerName = Environment.MachineName; break; default: throw new NotImplementedException("Database type not handled yet: " + databaseType.ToString()); } } connectionHelper.CurrentDbType = databaseType; if (proc.Exists("ServerName")) { connectionHelper.ServerName = proc.GetString("ServerName"); } if (proc.Exists("DatabaseName")) { connectionHelper.DatabaseName = proc.GetString("DatabaseName"); connectionHelper.UseFileName = false; } if (proc.Exists("FileName")) { connectionHelper.FileName = proc.GetString("FileName"); connectionHelper.UseFileName = true; } if (proc.Exists("UseIntegratedSecurity")) { connectionHelper.UseIntegratedSecurity = proc.GetBool("UseIntegratedSecurity"); } if (proc.Exists("UserName")) { connectionHelper.UserName = proc.GetString("UserName"); } if (proc.Exists("Password")) { string password = ""; try { password = proc.GetString("Password").Decrypt(); } catch { // Do nothing password = ""; } connectionHelper.Password = password; } if (proc.Exists("Port")) { connectionHelper.Port = proc.GetInt("Port"); } if (proc.Exists("ServiceName")) { connectionHelper.ServiceName = proc.GetString("ServiceName"); } if (proc.Exists("SchemaName")) { connectionHelper.ServiceName = proc.GetString("SchemaName"); } if (proc.Exists("UseDirectConnection")) { connectionHelper.UseDirectConnection = proc.GetBool("UseDirectConnection"); } else { connectionHelper.UseDirectConnection = false; } return(connectionHelper); }
private ConnectionStringHelper LoadGenericDatabaseData(XmlNode node, DatabaseTypes databaseType) { NodeProcessor proc = new NodeProcessor(node); var connectionHelper = new ConnectionStringHelper(); if (string.IsNullOrEmpty(connectionHelper.ServerName)) { switch (databaseType) { case DatabaseTypes.SQLCE: //case DatabaseTypes.SQLServer2000: case DatabaseTypes.SQLServer2005: connectionHelper.ServerName = Environment.MachineName; break; case DatabaseTypes.SQLServerExpress: connectionHelper.ServerName = Environment.MachineName + "\\SQLEXPRESS"; break; case DatabaseTypes.MySQL: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.Oracle: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.PostgreSQL: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.Firebird: connectionHelper.ServerName = "localhost"; break; case DatabaseTypes.SQLite: connectionHelper.ServerName = Environment.MachineName; break; default: throw new NotImplementedException("Database type not handled yet: " + databaseType.ToString()); } } connectionHelper.CurrentDbType = databaseType; if (proc.Exists("ServerName")) connectionHelper.ServerName = proc.GetString("ServerName"); if (proc.Exists("DatabaseName")) { connectionHelper.DatabaseName = proc.GetString("DatabaseName"); connectionHelper.UseFileName = false; } if (proc.Exists("FileName")) { connectionHelper.FileName = proc.GetString("FileName"); connectionHelper.UseFileName = true; } if (proc.Exists("UseIntegratedSecurity")) connectionHelper.UseIntegratedSecurity = proc.GetBool("UseIntegratedSecurity"); if (proc.Exists("UserName")) connectionHelper.UserName = proc.GetString("UserName"); if (proc.Exists("Password")) { string password = ""; try { password = proc.GetString("Password").Decrypt(); } catch { // Do nothing password = ""; } connectionHelper.Password = password; } if (proc.Exists("Port")) connectionHelper.Port = proc.GetInt("Port"); if (proc.Exists("ServiceName")) connectionHelper.ServiceName = proc.GetString("ServiceName"); if (proc.Exists("SchemaName")) connectionHelper.ServiceName = proc.GetString("SchemaName"); if (proc.Exists("UseDirectConnection")) connectionHelper.UseDirectConnection = proc.GetBool("UseDirectConnection"); else connectionHelper.UseDirectConnection = false; return connectionHelper; }
public IColumn ProcessColumnNode(XmlNode node) { IColumn column = new Column(); ProcessScriptBase(column, node); /* <Datatype>int</Datatype> <Default /> <InPrimaryKey>True</InPrimaryKey> <IsCalculated>False</IsCalculated> <IsComputed>False</IsComputed> <IsIdentity>False</IsIdentity> <IsNullable>False</IsNullable> <IsReadOnly>False</IsReadOnly> <IsUnique>True</IsUnique> <OrdinalPosition>1</OrdinalPosition> <Precision>10</Precision> <Scale>0</Scale> <Size>0</Size> */ NodeProcessor proc = new NodeProcessor(node); column.OriginalDataType = proc.GetString("Datatype"); column.Default = proc.GetString("Default"); column.InPrimaryKey = proc.GetBool("InPrimaryKey"); column.IsCalculated = proc.GetBool("IsCalculated"); column.IsComputed = proc.GetBool("IsComputed"); column.IsIdentity = proc.GetBool("IsIdentity"); column.IsNullable = proc.GetBool("IsNullable"); column.IsReadOnly = proc.GetBool("IsReadOnly"); column.IsUnique = proc.GetBool("IsUnique"); column.OrdinalPosition = proc.GetInt("OrdinalPosition"); column.Precision = proc.GetInt("Precision"); column.Scale = proc.GetInt("Scale"); column.Size = proc.GetLong("Size"); return column; }