public static DataSet LoadDatabaseSchema(ServerName sname, IEnumerable <DatabaseName> dnames) { DataSet ds = new DataSet(); ds.DataSetName = sname.Path; foreach (DatabaseName dname in dnames) { DataTable dt = LoadDatabaseSchema(dname); dt.TableName = dname.Name; ds.Tables.Add(dt); } return(ds); }
public static DataSet LoadDatabaseSchema(ServerName sname, IEnumerable <DatabaseName> dnames, Func <DatabaseName, string> sqlOfDatabaseSchema) { StringBuilder builder = new StringBuilder(); foreach (DatabaseName dname in dnames) { builder.AppendLine(sqlOfDatabaseSchema(dname)); } DataSet ds = new SqlCmd(sname.Provider, builder.ToString()).FillDataSet(); ds.DataSetName = sname.Path; int i = 0; foreach (DatabaseName dname in dnames) { ds.Tables[i++].TableName = dname.Name; } return(ds); }
public override DataSet GetServerSchema(ServerName sname) { return(InformationSchema.LoadDatabaseSchema(sname, sname.GetDatabaseNames(), CreateSQLOfDatabaseSchema)); }
public override DataSet GetServerSchema(ServerName sname) { return(LoadDatabaseSchema(sname, sname.GetDatabaseNames())); }
public override DataSet GetServerSchema(ServerName sname) { return(dbSchema); }
public override DataSet GetServerSchema(ServerName sname) { throw new NotImplementedException(); }
public abstract DataSet GetServerSchema(ServerName sname);
private string getSchemaFilName(ServerName sname) => string.Format("{0}\\{1}.{2}", getPath(sname), sname.Path, EXT);
private string getPath(ServerName sname) => string.Format("{0}\\{1}", XmlDbFolder, sname.Path);