Beispiel #1
0
        public string Next()
        {
            string str;

            if (this.int_0 != this.ilist_0.Count)
            {
                EnumBSTRClass int0 = this;
                int0.int_0 = int0.int_0 + 1;
                str        = this.ilist_0[this.int_0 - 1].ToString();
            }
            else
            {
                str = null;
            }
            return(str);
        }
Beispiel #2
0
        public IEnumBSTR Categories(string string_1)
        {
            IEnumBSTR enumBSTR;
            IEnumBSTR enumBSTRClass = new EnumBSTRClass();

            if (this.iarray_0.Count != 0)
            {
                try
                {
                    for (int i = 0; i < this.iarray_0.Count; i++)
                    {
                        string          str             = this.iarray_0.Element[i].ToString();
                        OleDbConnection oleDbConnection =
                            new OleDbConnection(string.Concat("Provider=Microsoft.Jet.OLEDB.4.0;Data source= ", str));
                        oleDbConnection.Open();
                        string         str1             = string.Concat("SELECT DISTINCT(Category) FROM [", string_1, "]");
                        IDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter(str1, oleDbConnection);
                        DataSet        dataSet          = new DataSet();
                        oleDbDataAdapter.Fill(dataSet);
                        oleDbConnection.Close();
                        for (int j = 0; j < dataSet.Tables[0].Rows.Count; j++)
                        {
                            try
                            {
                                (enumBSTRClass as IBStringArray).AddString(dataSet.Tables[0].Rows[j][0].ToString());
                            }
                            catch
                            {
                            }
                        }
                    }
                }
                catch
                {
                }
                enumBSTR = enumBSTRClass;
            }
            else
            {
                enumBSTR = enumBSTRClass;
            }
            return(enumBSTR);
        }