private void _CreateSubset(IEnumerable <DataRow> dt, DataSourceInformation info, DataColumnCollection header) { if (info.GetType() == typeof(DataFileInfo)) { DataFileInfo dfinfo = info as DataFileInfo; _CreateSubsetDataFileInfo(dt, dfinfo, header); } if (info.GetType() == typeof(SourceTableInfo)) { SourceTableInfo stinfo = info as SourceTableInfo; _CreateSubsetSourceTableInfo(dt, stinfo, header); } }
private void _CreateSubset(DataTable dt, DataSourceInformation info) { if (info.GetType() == typeof(DataFileInfo)) { DataFileInfo dfinfo = info as DataFileInfo; _CreateSubsetDataFileInfo(dt, dfinfo); } if (info.GetType() == typeof(SourceTableInfo)) { SourceTableInfo stinfo = info as SourceTableInfo; _CreateSubsetSourceTableInfo(dt, stinfo); } }
private void modeAddTable(string[] obj) { if (obj.Length != 5) { Console.Error.WriteLine("Correct usage: rds File -AddTable {Schemaname} {TableName} {ConnectionAlias}"); return; } //verify that a correct ConnectionAlias has been provided string alias = obj[4]; ConnectionAliases aliases = new ConnectionAliases(); if (!aliases.ContainsKey(alias)) { Console.Error.WriteLine($"Could not locate connection alias by name of {alias}. Use rds connection -Add {{alias}} {{connectionstring}} to add an alias"); return; } SourceTableInfo source = new SourceTableInfo(aliases[alias], obj[2], obj[3]); string filename = $"{Environment.CurrentDirectory}\\.rds\\{source.SourceName}{Settings.DataSourceFileExtension}"; source.SaveToFile(filename); }
private void _CreateSubsetSourceTableInfo(IEnumerable <DataRow> dt, SourceTableInfo info, DataColumnCollection header) { dt.ExportToSqlTable(header, info.ConnectionString, $"{info.SchemaName}.{info.TableName}{Settings.SqlTableSubsetPostfix}", AppendIfTableExists: false); }
private void _CreateSubsetSourceTableInfo(DataTable dt, SourceTableInfo info) { string schemaAndTable = $"{info.SchemaName}.{info.TableName}{Settings.SqlTableSubsetPostfix}"; dt.ExportToSqlTable(info.ConnectionString, schemaAndTable, true); }