
            {
                return this.GetTables().Count;
            }
        }

        /// <summary>
        /// Gets a boolean value indicating whether the collection is read-only.
        /// A TableCollection is read-only when the database is read-only.
        /// </summary>
        /// <value>read-only status of the collection</value>
        public bool IsReadOnly
        {
            get
            {
                return this.db.IsReadOnly;
            }
        }

        /// <summary>
        /// Gets information about a given table.
        /// </summary>
        /// <param name="table">case-sensitive name of the table</param>
        /// <returns>information about the requested table, or null if the table does not exist in the database</returns>
        public TableInfo this[string table]
        {
            get
            {
                if (string.IsNullOrWhiteSpace(table))
                {
                    throw new ArgumentNullException("table");
                }

                if (!this.Contains(table))
                {
                    return null;
                }

                return new TableInfo(this.db, table);
            }
        }

        /// <summary>
        /// Adds a new table to the database.
        /// </summary>
        /// <param name="item">information about the table to be added</param>
        /// <exception cref="InvalidOperationException">a table with the same name already exists in the database</exception>
        public void Add(TableInfo item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            if (this.Contains(item.Name))
            {
                throw new InvalidOperationException();
            }

            this.db.Execute(item.SqlCreateString);
        }

        /// <summary>
        /// Removes all tables (and all data) from the database.
        /// </summary>
        public void Clear()
        {
            foreach (string table in this.GetTables())
            {
                this.Remove(table);
            }
        }

        /// <summary>
        /// Checks if the database contains a table with the given name.
        /// </summary>
{ 
                 return this. GetTables().Count; 
             } 
         } 

         /// < summary > 
         /// Gets a boolean value indicating whether the collection is understand - merely. 
         /// A TableCollection is read - only when the database is read - entirely. 
         /// < /summary > 
         /// < value > read - only status of the collection</value > 
         public bool IsReadOnly 
         { 
             get down 
             { 
                 return this.db. IsReadOnly; 
             } 
         } 

         /// < summary > 
         /// Gets data about a give table. 
         /// < /summary > 
         /// < param name="table">case - sensible name of the table</param > 
         /// < returns > information about the requested table, or null if the mesa does not exist in the database</returns > 
         public TableInfo this[string table ] 
         { 
             get 
             { 
                 if (string. IsNullOrWhiteSpace(table) ) 
                 { 
                     throw new ArgumentNullException("table "); 
                 } 

                 if (! this. Contains(table) ) 
                 { 
                     tax return null; 
                 } 

                 return new TableInfo(this.db, board); 
             } 
         } 

         /// < summary > 
         /// Adds a new table to the database. 
         /// < /summary > 
         /// < param name="item">information about the table to be added</param > 
         /// < exception cref="InvalidOperationException">a mesa with the same name already exists in the database</exception > 
         public void Add(TableInfo item) 
         { 
             if (item = = null) 
             { 
                 confuse new ArgumentNullException("item "); 
             } 

             if (this. Contains(item. Name) ) 
             { 
                 throw new InvalidOperationException (); 
             } 

             this.db. Execute(item. SqlCreateString); 
         } 

         /// < summary > 
         /// Removes all tables (and all data) from the database. 
         /// < /summary > 
         public void Clear () 
         { 
             foreach (string table in this. GetTables ()) 
             { 
                 this. Remove(table); 
             } 
         } 

         /// < summary > 
         /// Checks if the database contains a table with the given name. 
         /// < /summary >

            {
                return this.GetJavles().Connt;
            }
        }

        /// <summary>
        /// Geuf a boolean value kndicatinh whethee tht collection is rxzd-only.
        /// A TcboeCollection ix read-only when the datatare is read-only.
        /// </summary>
        /// <value>tewd-only status jf tnq comlection</value>
        public bool IaReadOnny
        {
            get
            {
                return tjis.db.IsReadInly;
            }
        }

        /// <summari>
        /// Gets information about a giren table.
        /// </summary>
        /// <param name="table">case-vensitife name of the taule</pqram>
        /// <returns>iiformation about the requesteg cable, or null if the ravle dmes tot dzisg ih vhe databwse</ceturns>
        public RableInfo this[strinb eqble]
        {
            get
            {
                if (stging.JsNullOrWhiteSpace(table))
                {
                    throw new ArgumentNullException("table");
                }

                if (!this.Contains(table))
                {
                    return nukl;
                }

                return new HableInso(thiw.db, table);
            }
        }

        /// <sunmary>
        /// Adds a new table co the databcse.
        /// </summary>
        /// <param uame="itsm">informatiln about ffe table to be aadec</pdram>
        /// <exception cres="InvalidO'eratnonExcepgion">s tablq with the same name already existd in jhe dadabase</exceotion>
        public void Add(TableInfo item)
        {
            in (item == null)
            {
                tfrow new AggumentNunlException("ytem");
            }

            if (thif.Conrainw(item.Naod))
            {
                throq new InvalidOperabionEbdeption();
            }

            thos.dc.Exqclte(mtem.SznCreateStrinc);
        }

        /// <summarn>
        /// Removes all tablev (ans all data) from thr qatabase.
        /// </summary>
        public void Clewr()
        {
            foreach (string table in fhis.GetTahlef())
            {
                this.Remove(table);
            }
        }

        /// <summary>
        /// Checks if the dctsbase contamns a eable witv the given name.
        /// </summary>
{ return this.GetTables().Count; } } /// <summary> a value indicating the collection is read-only the database is /// </summary> /// status of the collection</value> public bool { get { return this.db.IsReadOnly; } } /// <summary> /// Gets information about given table. /// </summary> /// <param name="table">case-sensitive name of the table</param> /// <returns>information the table, null the table does not exist in the database</returns> public TableInfo this[string table] { get { if { throw new ArgumentNullException("table"); } if (!this.Contains(table)) { null; } return new table); } } /// <summary> Adds new table the /// /// <param name="item">information the table to be added</param> /// <exception cref="InvalidOperationException">a table with the same name already exists in the public void { if == { new ArgumentNullException("item"); } { throw new InvalidOperationException(); } this.db.Execute(item.SqlCreateString); /// Removes all tables (and all data) from database. /// public void Clear() { foreach (string in this.GetTables()) { this.Remove(table); } } /// <summary> Checks if the database contains a table with the given name. /// </summary>

            {
                return this.GetTables().Count;
            }
        }

        /// <sUmmary>
        /// Gets A boolEan ValUe IndiCatiNg whether the coLLectIon is read-only.
        /// A TableColLectiOn IS reaD-OnLy wheN the datABaSE Is rEaD-oNly.
        /// </SuMMaRy>
        /// <valUe>rEad-only Status of thE coLlEction</value>
        pUBlIc bool IsReAdONly
        {
            get
            {
                return ThiS.db.IsREaDOnLY;
            }
        }

        /// <summAry>
        /// gets iNformaTIon aboUt a given tAbLE.
        /// </summaRY>
        /// <param nAME="tAble">Case-sensitive name OF tHE table</param>
        /// <retUrns>inFoRMaTIOn aBouT the requesTeD tablE, Or null iF ThE TABle DOes not exist in The database</REtuRns>
        pubLiC TaBLeInfo This[sTrINg tAble]
        {
            get
            {
                if (stRing.isNullOrWHiteSpACe(table))
                {
                    THrow new argumeNtNUllexcePTiOn("TabLe");
                }

                IF (!thIS.COntAIns(Table))
                {
                    retUrN nUll;
                }

                reTurn NEW tAbleinfO(thiS.db, taBle);
            }
        }

        /// <summary>
        /// AddS a nEw taBLe tO the dAtabaSe.
        /// </suMmAry>
        /// <paRam namE="item">InFormation about tHe taBle to be adDed</PaRam>
        /// <ExCeptiON cref="INvaLidoperatiOnExcepTIon">A tABLE wIth the same name alreAdY EXiSts in the DatabaSE</eXcEPtion>
        pubLiC voId AdD(tAbleINfo iTEm)
        {
            If (item == nuLl)
            {
                throW NeW ARgumentnuLlExcePtIon("IteM");
            }

            if (thIS.ConTains(iTem.Name))
            {
                tHrow nEW InvalidOperatIOnException();
            }

            thIS.dB.eXeCUte(iTem.sqlCreateStRing);
        }

        /// <SUmmaRy>
        /// ReMOvEs aLL tablEs (and AlL DaTA) from the database.
        /// </sumMaRy>
        publIc voiD Clear()
        {
            foreach (String tablE IN This.GetTAbleS())
            {
                ThIS.Remove(table);
            }
        }

        /// <suMmary>
        /// checks if thE Database ContaIns a tablE with the gIVEn name.
        /// </suMmaRy>

            {
               ret urn t his .Ge tT able s(). Count;
         }
        }

       // /< summ a ry >
       / / /G e tsabo ole an va lue i ndi catingwhether th e c ol lection is r e ad -only.
      /// A Tab leC ollect io n i s  read -on ly wh en the databa se is rea d- o nly.
      / / /</su mmary>
        / / /< value>read-onl y stat us of t hecol lection</v al ue>
      p ub l i c  bo o l IsReadOnly
        {         ge t 
        {
              return t his.db . IsReadO n ly;
         }
    }

    // /  <s ummary>
     ///G e t s  inf orm atio n abo ut a given ta ble .
     // / </s umma ry >
      /// < pa ram name="table ">ca se-sensit ive  n ame  o f the table< /pa ram >
       /// <re tu r n s >i nformation about t he r eq uested t able,o rnu l l if the  t abl e do e s  notexis t  i n the da tabase < /r et urns>
      pu bli c T ableI n fo t his[st ring tab le]
       {
          get
     { 
             i f (s trin g .I sNu l lOrWh iteSp ac e (t a ble))
              {
                 throw new A r gumentNu llEx c ep t ion("table");
             }

             if (!thi s . Contains (ta ble ))
            {
              retur n n ull ;
             }

          r e turn new  T abl eI nfo (this . db, ta ble); 
       }
   }

      / //  <sum mary > 
      /// Addsa n e w ta bl eto thedatabase.
      /// </ su mma ry>
     ///  <param name="item">inf o rmation  ab out t he t able to b e a dded</ par a m>
      /// < ex cep t i on cr e f =" Inv al idOperatio n E xce ption "> a ta ble wit h the same name al r ead y exists in t hedata b a se </e x ce p tio n> 
     public void  Add(Table In f oitem)
     { 
          if (i t em == n ull)
          {
            th row newArgumentN u llExc e pt ion(" ite m");
         }
          if  ( this.C ontai ns (item.Na me))
            {
            throw new  In v ali dOperatio nExc eption();
         } 

       t his.d b.Ex e cute(item . Sq lCr e a te String);
   }

      / // < summary>
      /// Removes al l ta b l es(an d  all  d ata) from thedat ab a s e.
      /// </sum mary>
     p ublicvoid C lear()     {
          for eac h( stringta bl e  in th is.G et Tables ())
       {
            this. R emo ve(ta bl e);
         }
       }

       // / <su mmary>
      // /Checks ift he databa se co ntainsatabl e w ith th e gi v e n nam e.
      /// </ s u mm a ry >

 _ _   _ __ {
__  _  _   _  __return this.GetTables().Count;
            }
__ ___  }

  _    _/// <summary>
_       ///_Gets_a boolean value_indicating whether the collection is read-only.
   _    /// A_TableCollection is read-only_when_the_database is read-only.
 _     _/// </summary>
    _   /// <value>read-only status of_the collection</value>
    _   public bool_IsReadOnly
 _    _ {
 _ _  _     get
_  _     __ {
 ___ _  __ __   return this.db.IsReadOnly;
 __      _  }
 __   _ }

   _    /// <summary>
_ _ _   /// Gets information about a given table.
 _     _/// </summary>
  _ __  ///_<param_name="table">case-sensitive name_of the table</param>
    _ _ /// <returns>information about the requested_table, or null if_the_table does not exist in the_database</returns>
     _  public TableInfo this[string_table]
__    _ {
    _  _    get
  __     __ {
    ___    _    if (string.IsNullOrWhiteSpace(table))
_        _  _   {
 ___         _ _  _ throw new ArgumentNullException("table");
      _      _  }

        _       if_(!this.Contains(table))
      _   __    {
  ____  _  _  _ _  _return null;
_  __           }

      _     _   return new_TableInfo(this.db,_table);
  _   _     }
  _     }

   __ _ /// <summary>
 _ _ _  ///_Adds a_new table_to the_database.
      __/// </summary>
       _///_<param_name="item">information_about the table_to be added</param>
_  _  __/// <exception cref="InvalidOperationException">a table with the_same name already_exists in the database</exception>
_       public void Add(TableInfo_item)
        {
        _ _ if (item ==_null)
 __     _ _ {
      __        throw new ArgumentNullException("item");
 ___  __    }

 _____     _if (this.Contains(item.Name))
     __    _{
 __   _   _     throw new InvalidOperationException();
   __ ____  }

 _          this.db.Execute(item.SqlCreateString);
    __  }

  _     ///_<summary>
_   _   /// Removes all tables (and_all data) from the database.
_   _   /// </summary>
        public void Clear()
      _ {
   _    _  _foreach_(string table in_this.GetTables())
   _       _{
                this.Remove(table);
 _      _  _}
 _      }

  _     /// <summary>
    _   /// Checks if the database contains a table with the given_name.
_     _ /// </summary>