Beispiel #1
0
        public int ExecuteNonQuery(string filepath, string query, string[] parameters, ExcelProperties properties)
        {
            filepath = getCannolizePath(filepath);
            //logger.Trace("ExecuteNonQuery(string filepath, string query, string[] parameters, ExcelProperties properties)");

            if (string.IsNullOrEmpty(filepath))
            {
                throw new Exception(ExcelResources.DataSourceEmpty);
            }
            if (string.IsNullOrEmpty(query))
            {
                throw new Exception(ExcelResources.QueryEmpty);
            }

            OpenXmlClient con = new OpenXmlClient();

            return(con.ExecuteNonQuery(query, parameters, filepath));;
        }
Beispiel #2
0
        public DataTable GetOleDbSchemaTable(string filepath, Guid schema, string[] parameters, ExcelProperties properties)
        {
            filepath = getCannolizePath(filepath);

            if (string.IsNullOrEmpty(filepath))
            {
                throw new Exception(ExcelResources.DataSourceEmpty);
            }
            if (schema == null || string.IsNullOrEmpty(schema.ToString()))
            {
                throw new Exception(ExcelResources.SchemaEmpty);
            }


            OpenXmlClient openxmlcon = new OpenXmlClient();
            DataTable     openxmltbl = openxmlcon.GetSchemaTable(filepath);

            return(openxmltbl);
        }
Beispiel #3
0
        public int ExecuteMultipleQuery(string filepath, string[] query, ExcelProperties properties)
        {
            filepath = getCannolizePath(filepath);

            if (string.IsNullOrEmpty
                    (filepath))
            {
                throw new Exception(ExcelResources.DataSourceEmpty);
            }
            if (query.Length == 0)
            {
                throw new Exception(ExcelResources.QueryEmpty);
            }


            OpenXmlClient con = new OpenXmlClient();

            con.ExecuteMultipleQuery(filepath, query);

            return(1);
        }