Пример #1
0
        /// <summary>
        /// Check whether there are matching records that match the specified filter
        /// </summary>
        /// <param name="provider">The connection string for the data source</param>
        /// <param name="password">The encrypted data source password</param>
        /// <param name="query">The SQL query for filtering the data</param>
        /// <param name="connectionType">The type of data connection (i.e. ADO or SQL)</param>
        /// <returns></returns>
        public DataSet matchFound(string provider, string password, string query, string connectionType)
        {
            New_Wrapper.DataHandler myHandler = new New_Wrapper.DataHandler();
            switch (connectionType)
            {
            //  case "ADO":
            //      myHandler = new New_Wrapper.DataHandler(provider, password, query); // password to connect ADO to Access no longer required.
            //      break;
            case "SQL":
                myHandler = new New_Wrapper.DataHandler(provider, query);
                break;

            default:
                throw new Exception("Unrecognised connection type.");
            }
            DataSet temp = myHandler.CreateDataset();

            myHandler.CloseConnection();
            myHandler = null;
            return(temp);
        }