Example #1
0
        /// <summary>
        /// Convert a Microsoft Access database into a DataSet
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public DataSet ImportAccess(string filename)
        {
            //    Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Jet OLEDB:Database Password=MyDbPassword;
            string connectionString = string.Format(
                @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};User Id=admin;Password=;",
                filename);

            OleDbManager m = new OleDbManager(connectionString);

            return(m.FillTables());
        }
Example #2
0
        /// <summary>
        /// Convert a Microsoft Excel into a DataSet
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public DataSet ImportExcel(string filename)
        {
            string connectionString = string.Format(
                @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;HDR={1};IMEX=1"";",
                filename,
                useHeaderRow ? "Yes" : "No");

            OleDbManager m = new OleDbManager(connectionString);

            return(m.FillTables());
        }