GetSchema() public method

public GetSchema ( string collection, String restrictions ) : DataTable
collection string
restrictions String
return System.Data.DataTable
コード例 #1
0
        /// <summary>
        /// Returns schema information for the data source of this
        /// <see cref="DbConnection"/> using the specified string for the schema name.
        /// </summary>
        /// <param name="collectionName">Specifies the name of the schema to return. </param>
        /// <returns>A <see cref="DataTable"/> that contains schema information. </returns>
        public override DataTable GetSchema(string collectionName)
        {
            if (collectionName == null)
            {
                collectionName = SchemaProvider.MetaCollection;
            }

            return(schemaProvider.GetSchema(collectionName, null));
        }
コード例 #2
0
ファイル: Connection.cs プロジェクト: sleepingwit/jal123
        public MySqlSchemaCollection GetSchemaCollection(string collectionName, string[] restrictionValues)
        {
            if (collectionName == null)
            {
                collectionName = SchemaProvider.MetaCollection;
            }

            string[] restrictions   = _schemaProvider.CleanRestrictions(restrictionValues);
            MySqlSchemaCollection c = _schemaProvider.GetSchema(collectionName, restrictions);

            return(c);
        }
コード例 #3
0
        /// <summary>
        /// Returns schema information for the data source of this <see cref="DbConnection"/>
        /// using the specified string for the schema name and the specified string array
        /// for the restriction values.
        /// </summary>
        /// <param name="collectionName">Specifies the name of the schema to return.</param>
        /// <param name="restrictionValues">Specifies a set of restriction values for the requested schema.</param>
        /// <returns>A <see cref="DataTable"/> that contains schema information.</returns>
        public override DataTable GetSchema(string collectionName, string[] restrictionValues)
        {
            if (collectionName == null)
            {
                collectionName = SchemaProvider.MetaCollection;
            }

            string[]  restrictions = schemaProvider.CleanRestrictions(restrictionValues);
            DataTable dt           = schemaProvider.GetSchema(collectionName, restrictions);

            return(dt);
        }
コード例 #4
0
        /// <summary>
        /// Returns schema information for the data source of this <see cref="DbConnection"/>
        /// using the specified string for the schema name and the specified string array
        /// for the restriction values.
        /// </summary>
        /// <param name="collectionName">Specifies the name of the schema to return.</param>
        /// <param name="restrictionValues">Specifies a set of restriction values for the requested schema.</param>
        /// <returns>A <see cref="DataTable"/> that contains schema information.</returns>
        public override DataTable GetSchema(string collectionName, string[] restrictionValues)
        {
/*            string msg = String.Format("collection name2 = {0}", collectionName);
 *          if (restrictionValues != null)
 *              foreach (string s in restrictionValues)
 *              {
 *                  msg += String.Format(" res={0}", s);
 *              }
 *          System.Windows.Forms.MessageBox.Show(msg);
 */
            if (collectionName == null)
            {
                collectionName = SchemaProvider.MetaCollection;
            }

            string[] restrictions = null;
            if (restrictionValues != null)
            {
                restrictions = (string[])restrictionValues.Clone();

                for (int x = 0; x < restrictions.Length; x++)
                {
                    string s = restrictions[x];
                    if (s != null)
                    {
                        if (s.StartsWith("`"))
                        {
                            s = s.Substring(1);
                        }
                        if (s.EndsWith("`"))
                        {
                            s = s.Substring(0, s.Length - 1);
                        }
                        restrictions[x] = s;
                    }
                }
            }

            DataTable dt = schemaProvider.GetSchema(collectionName, restrictions);

            return(dt);
        }