//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.42
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.42.
// 
#pragma warning disable 1591

namespace ConsoleApplication2.canopus5 {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    using System.Data;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="SQLServerSoap", Namespace="urn:other")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(xml))]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SqlParameter[]))]
    public partial class SQLServer : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback sqlbatchOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public SQLServer() {
            this.Url = global::ConsoleApplication2.Properties.Settings.Default.ConsoleApplication2_canopus5_SQLServer;
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url) == true) 
                            && (this.useDefaultCredentialsSetExplicitly == false)) 
                            && (this.IsLocalFileSystemWebService(value) == false))) {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }
        
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials = value;
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        /// <remarks/>
        public event sqlbatchCompletedEventHandler sqlbatchCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/2004/SOAPsqlbatch", RequestNamespace="http://schemas.microsoft.com/sqlserver/2004/SOAP", ResponseNamespace="http://schemas.microsoft.com/sqlserver/2004/SOAP", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlArrayItemAttribute(typeof(SqlMessage), Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream", IsNullable=false)]
        [return: System.Xml.Serialization.XmlArrayItemAttribute("SqlResultCode", typeof(int), Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream", IsNullable=false)]
        [return: System.Xml.Serialization.XmlArrayItemAttribute(typeof(SqlRowCount), Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream", IsNullable=false)]
        [return: System.Xml.Serialization.XmlArrayItemAttribute("SqlRowSet", typeof(System.Data.DataSet), Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream", IsNullable=false)]
        [return: System.Xml.Serialization.XmlArrayItemAttribute(typeof(SqlTransaction), Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream", IsNullable=false)]
        [return: System.Xml.Serialization.XmlArrayItemAttribute("SqlXml", typeof(System.Xml.XmlNode), Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream", IsNullable=false)]
        public object[] sqlbatch(string BatchCommands, [System.Xml.Serialization.XmlArrayAttribute(IsNullable=true)] [System.Xml.Serialization.XmlArrayItemAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlParameter", IsNullable=false)] ref SqlParameter[] Parameters) {
            object[] results = this.Invoke("sqlbatch", new object[] {
                        BatchCommands,
                        Parameters});
            Parameters = ((SqlParameter[])(results[1]));
            return ((object[])(results[0]));
        }
        
        /// <remarks/>
        public void sqlbatchAsync(string BatchCommands, SqlParameter[] Parameters) {
            this.sqlbatchAsync(BatchCommands, Parameters, null);
        }
        
        /// <remarks/>
        public void sqlbatchAsync(string BatchCommands, SqlParameter[] Parameters, object userState) {
            if ((this.sqlbatchOperationCompleted == null)) {
                this.sqlbatchOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsqlbatchOperationCompleted);
            }
            this.InvokeAsync("sqlbatch", new object[] {
                        BatchCommands,
                        Parameters}, this.sqlbatchOperationCompleted, userState);
        }
        
        private void OnsqlbatchOperationCompleted(object arg) {
            if ((this.sqlbatchCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.sqlbatchCompleted(this, new sqlbatchCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
        
        private bool IsLocalFileSystemWebService(string url) {
            if (((url == null) 
                        || (url == string.Empty))) {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024) 
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlParameter")]
    public partial class SqlParameter {
        
        private object valueField;
        
        private string nameField;
        
        private sqlDbTypeEnum sqlDbTypeField;
        
        private ParameterDirection directionField;
        
        private long maxLengthField;
        
        private byte precisionField;
        
        private byte scaleField;
        
        private string clrTypeNameField;
        
        private sqlCompareOptionsEnum[] sqlCompareOptionsField;
        
        private int localeIdField;
        
        private int sqlCollationVersionField;
        
        private int sqlSortIdField;
        
        private string xmlSchemaCollectionField;
        
        public SqlParameter() {
            this.sqlDbTypeField = sqlDbTypeEnum.NVarChar;
            this.directionField = ParameterDirection.Input;
            this.maxLengthField = ((long)(1));
            this.precisionField = ((byte)(18));
            this.scaleField = ((byte)(0));
            this.clrTypeNameField = "";
            this.sqlCompareOptionsField = new sqlCompareOptionsEnum[] {
                    sqlCompareOptionsEnum.Default};
            this.localeIdField = -1;
            this.sqlCollationVersionField = 0;
            this.sqlSortIdField = 0;
            this.xmlSchemaCollectionField = "";
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
        public object Value {
            get {
                return this.valueField;
            }
            set {
                this.valueField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        public string name {
            get {
                return this.nameField;
            }
            set {
                this.nameField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(sqlDbTypeEnum.NVarChar)]
        public sqlDbTypeEnum sqlDbType {
            get {
                return this.sqlDbTypeField;
            }
            set {
                this.sqlDbTypeField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ParameterDirection.Input)]
        public ParameterDirection direction {
            get {
                return this.directionField;
            }
            set {
                this.directionField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(typeof(long), "1")]
        public long maxLength {
            get {
                return this.maxLengthField;
            }
            set {
                this.maxLengthField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(typeof(byte), "18")]
        public byte precision {
            get {
                return this.precisionField;
            }
            set {
                this.precisionField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(typeof(byte), "0")]
        public byte scale {
            get {
                return this.scaleField;
            }
            set {
                this.scaleField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute("")]
        public string clrTypeName {
            get {
                return this.clrTypeNameField;
            }
            set {
                this.clrTypeNameField = value;
            }
        }
        
        /// <remarks/>
        // CODEGEN Warning: DefaultValue attribute on members of type sqlCompareOptionsEnum[] is not supported in this version of the .Net Framework.
        [System.Xml.Serialization.XmlAttributeAttribute()]
        public sqlCompareOptionsEnum[] sqlCompareOptions {
            get {
                return this.sqlCompareOptionsField;
            }
            set {
                this.sqlCompareOptionsField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(-1)]
        public int localeId {
            get {
                return this.localeIdField;
            }
            set {
                this.localeIdField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(0)]
        public int sqlCollationVersion {
            get {
                return this.sqlCollationVersionField;
            }
            set {
                this.sqlCollationVersionField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(0)]
        public int sqlSortId {
            get {
                return this.sqlSortIdField;
            }
            set {
                this.sqlSortIdField = value;
            }
        }
        
        /// <remarks/>
        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute("")]
        public string xmlSchemaCollection {
            get {
                return this.xmlSchemaCollectionField;
            }
            set {
                this.xmlSchemaCollectionField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlTransaction")]
    public partial class SqlTransaction {
        
        private byte[] descriptorField;
        
        private SqlTransactionType typeField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")]
        public byte[] Descriptor {
            get {
                return this.descriptorField;
            }
            set {
                this.descriptorField = value;
            }
        }
        
        /// <remarks/>
        public SqlTransactionType Type {
            get {
                return this.typeField;
            }
            set {
                this.typeField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
    public enum SqlTransactionType {
        
        /// <remarks/>
        Begin,
        
        /// <remarks/>
        Commit,
        
        /// <remarks/>
        Rollback,
        
        /// <remarks/>
        EnlistDTC,
        
        /// <remarks/>
        Defect,
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlMessage")]
    public partial class SqlMessage {
        
        private int classField;
        
        private int lineNumberField;
        
        private string messageField;
        
        private int numberField;
        
        private string procedureField;
        
        private string serverField;
        
        private string sourceField;
        
        private int stateField;
        
        /// <remarks/>
        public int Class {
            get {
                return this.classField;
            }
            set {
                this.classField = value;
            }
        }
        
        /// <remarks/>
        public int LineNumber {
            get {
                return this.lineNumberField;
            }
            set {
                this.lineNumberField = value;
            }
        }
        
        /// <remarks/>
        public string Message {
            get {
                return this.messageField;
            }
            set {
                this.messageField = value;
            }
        }
        
        /// <remarks/>
        public int Number {
            get {
                return this.numberField;
            }
            set {
                this.numberField = value;
            }
        }
        
        /// <remarks/>
        public string Procedure {
            get {
                return this.procedureField;
            }
            set {
                this.procedureField = value;
            }
        }
        
        /// <remarks/>
        public string Server {
            get {
                return this.serverField;
            }
            set {
                this.serverField = value;
            }
        }
        
        /// <remarks/>
        public string Source {
            get {
                return this.sourceField;
            }
            set {
                this.sourceField = value;
            }
        }
        
        /// <remarks/>
        public int State {
            get {
                return this.stateField;
            }
            set {
                this.stateField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlRowCount")]
    public partial class SqlRowCount {
        
        private long countField;
        
        /// <remarks/>
        public long Count {
            get {
                return this.countField;
            }
            set {
                this.countField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes")]
    public partial class xml {
        
        private System.Xml.XmlNode[] anyField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlTextAttribute()]
        [System.Xml.Serialization.XmlAnyElementAttribute()]
        public System.Xml.XmlNode[] Any {
            get {
                return this.anyField;
            }
            set {
                this.anyField = value;
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes")]
    public enum sqlDbTypeEnum {
        
        /// <remarks/>
        BigInt,
        
        /// <remarks/>
        Binary,
        
        /// <remarks/>
        Bit,
        
        /// <remarks/>
        Char,
        
        /// <remarks/>
        DateTime,
        
        /// <remarks/>
        Decimal,
        
        /// <remarks/>
        Float,
        
        /// <remarks/>
        Image,
        
        /// <remarks/>
        Int,
        
        /// <remarks/>
        Money,
        
        /// <remarks/>
        NChar,
        
        /// <remarks/>
        NText,
        
        /// <remarks/>
        NVarChar,
        
        /// <remarks/>
        Real,
        
        /// <remarks/>
        SmallDateTime,
        
        /// <remarks/>
        SmallInt,
        
        /// <remarks/>
        SmallMoney,
        
        /// <remarks/>
        Text,
        
        /// <remarks/>
        Timestamp,
        
        /// <remarks/>
        TinyInt,
        
        /// <remarks/>
        Udt,
        
        /// <remarks/>
        UniqueIdentifier,
        
        /// <remarks/>
        VarBinary,
        
        /// <remarks/>
        VarChar,
        
        /// <remarks/>
        Variant,
        
        /// <remarks/>
        Xml,
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlParameter")]
    public enum ParameterDirection {
        
        /// <remarks/>
        Input,
        
        /// <remarks/>
        InputOutput,
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes")]
    public enum sqlCompareOptionsEnum {
        
        /// <remarks/>
        Default,
        
        /// <remarks/>
        None,
        
        /// <remarks/>
        IgnoreCase,
        
        /// <remarks/>
        IgnoreNonSpace,
        
        /// <remarks/>
        IgnoreKanaType,
        
        /// <remarks/>
        IgnoreWidth,
        
        /// <remarks/>
        BinarySort,
        
        /// <remarks/>
        BinarySort2,
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")]
    public delegate void sqlbatchCompletedEventHandler(object sender, sqlbatchCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class sqlbatchCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal sqlbatchCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public object[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((object[])(this.results[0]));
            }
        }
        
        /// <remarks/>
        public SqlParameter[] Parameters {
            get {
                this.RaiseExceptionIfNecessary();
                return ((SqlParameter[])(this.results[1]));
            }
        }
    }
}

#pragma warning restore 1591