internal OdbcConnectionString(string connectionString, bool validate) : base(connectionString, null, true)
 {
     if (!validate)
     {
         string filename = null;
         int    position = 0;
         this._expandedConnectionString = base.ExpandDataDirectories(ref filename, ref position);
     }
     if ((validate || (this._expandedConnectionString == null)) && ((connectionString != null) && (0x400 < connectionString.Length)))
     {
         throw ODBC.ConnectionStringTooLong();
     }
 }
示例#2
0
 internal OdbcConnectionString(string connectionString, bool validate) : base(connectionString, null, true)
 {
     if (!validate)
     {
         string filename = null;
         int    position = 0;
         _expandedConnectionString = ExpandDataDirectories(ref filename, ref position);
     }
     if (validate || (null == _expandedConnectionString))
     {
         // do not check string length if it was expanded because the final result may be shorter than the original
         if ((null != connectionString) && (ODBC32.MAX_CONNECTION_STRING_LENGTH < connectionString.Length))   // MDAC 83536
         {
             throw ODBC.ConnectionStringTooLong();
         }
     }
 }