Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public override DataSet GetServerSchema(ServerName sname)
 {
     return(InformationSchema.LoadDatabaseSchema(sname, sname.GetDatabaseNames(), CreateSQLOfDatabaseSchema));
 }
Exemple #4
0
 public override DataSet GetServerSchema(ServerName sname)
 {
     return(LoadDatabaseSchema(sname, sname.GetDatabaseNames()));
 }
Exemple #5
0
 public override DataSet GetServerSchema(ServerName sname)
 {
     return(dbSchema);
 }
Exemple #6
0
 public override DataSet GetServerSchema(ServerName sname)
 {
     throw new NotImplementedException();
 }
Exemple #7
0
 public abstract DataSet GetServerSchema(ServerName sname);
Exemple #8
0
 private string getSchemaFilName(ServerName sname) => string.Format("{0}\\{1}.{2}", getPath(sname), sname.Path, EXT);
Exemple #9
0
 private string getPath(ServerName sname) => string.Format("{0}\\{1}", XmlDbFolder, sname.Path);