Exemple #1
0
 internal void GetSqlTableInfo()
 {
     string cmdText = "exec sp_tables";
     SqlCommand selectCommand = new SqlCommand(cmdText, this.SqlConn);
     DataSet dataSet = new DataSet();
     new SqlDataAdapter(selectCommand).Fill(dataSet, "Tables");
     this.m_AllTables = new SqlTableInfoArray();
     this.m_UserTables = new SqlTableInfoArray();
     this.m_SystemTables = new SqlTableInfoArray();
     this.m_Views = new SqlTableInfoArray();
     foreach (DataRow row in dataSet.Tables[0].Rows)
     {
       SqlTableInfo sqlTableInfo = new SqlTableInfo(this, row);
       this.m_AllTables.Add(sqlTableInfo);
       switch (sqlTableInfo.Type)
       {
     case TableType.Table:
       {
     this.m_UserTables.Add(sqlTableInfo);
     continue;
       }
     case TableType.SystemTable:
       {
     this.m_SystemTables.Add(sqlTableInfo);
     continue;
       }
     case TableType.View:
       {
     this.m_Views.Add(sqlTableInfo);
     continue;
       }
       }
     }
 }
Exemple #2
0
 public void Reload()
 {
     this.m_AllTables = null;
     this.m_SystemTables = null;
     this.m_UserTables = null;
     this.m_Views = null;
     this.m_StoredProcs = null;
 }