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

namespace DataBindingsMsSQL {
    using System;
    
    
    [Serializable()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.ComponentModel.ToolboxItem(true)]
    [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
    [System.Xml.Serialization.XmlRootAttribute("AdventureWorksDataSet")]
    [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
    [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage", "CA2240:ImplementISerializableCorrectly")]
    public partial class AdventureWorksDataSet : System.Data.DataSet {
        
        private ContactDataTable tableContact;
        
        private System.Data.SchemaSerializationMode _schemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
        
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public AdventureWorksDataSet() {
            this.BeginInit();
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            base.Tables.CollectionChanged += schemaChangedHandler;
            base.Relations.CollectionChanged += schemaChangedHandler;
            this.EndInit();
        }
        
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        protected AdventureWorksDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                base(info, context) {
            if ((this.IsBinarySerialized(info, context) == true)) {
                this.InitVars(false);
                System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
                this.Tables.CollectionChanged += schemaChangedHandler1;
                this.Relations.CollectionChanged += schemaChangedHandler1;
                return;
            }
            string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
            if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
                System.Data.DataSet ds = new System.Data.DataSet();
                ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
                if ((ds.Tables["Contact"] != null)) {
                    base.Tables.Add(new ContactDataTable(ds.Tables["Contact"]));
                }
                this.DataSetName = ds.DataSetName;
                this.Prefix = ds.Prefix;
                this.Namespace = ds.Namespace;
                this.Locale = ds.Locale;
                this.CaseSensitive = ds.CaseSensitive;
                this.EnforceConstraints = ds.EnforceConstraints;
                this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
                this.InitVars();
            }
            else {
                this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
            }
            this.GetSerializationData(info, context);
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            base.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)]
        public ContactDataTable Contact {
            get {
                return this.tableContact;
            }
        }
        
        public override System.Data.SchemaSerializationMode SchemaSerializationMode {
            get {
                return this._schemaSerializationMode;
            }
            set {
                this._schemaSerializationMode = value;
            }
        }
        
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public new System.Data.DataTableCollection Tables {
            get {
                return base.Tables;
            }
        }
        
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
        public new System.Data.DataRelationCollection Relations {
            get {
                return base.Relations;
            }
        }
        
        [System.ComponentModel.DefaultValueAttribute(true)]
        public new bool EnforceConstraints {
            get {
                return base.EnforceConstraints;
            }
            set {
                base.EnforceConstraints = value;
            }
        }
        
        protected override void InitializeDerivedDataSet() {
            this.BeginInit();
            this.InitClass();
            this.EndInit();
        }
        
        public override System.Data.DataSet Clone() {
            AdventureWorksDataSet cln = ((AdventureWorksDataSet)(base.Clone()));
            cln.InitVars();
            return cln;
        }
        
        protected override bool ShouldSerializeTables() {
            return false;
        }
        
        protected override bool ShouldSerializeRelations() {
            return false;
        }
        
        protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
            if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
                this.Reset();
                System.Data.DataSet ds = new System.Data.DataSet();
                ds.ReadXml(reader);
                if ((ds.Tables["Contact"] != null)) {
                    base.Tables.Add(new ContactDataTable(ds.Tables["Contact"]));
                }
                this.DataSetName = ds.DataSetName;
                this.Prefix = ds.Prefix;
                this.Namespace = ds.Namespace;
                this.Locale = ds.Locale;
                this.CaseSensitive = ds.CaseSensitive;
                this.EnforceConstraints = ds.EnforceConstraints;
                this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
                this.InitVars();
            }
            else {
                this.ReadXml(reader);
                this.InitVars();
            }
        }
        
        protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
            System.IO.MemoryStream stream = new System.IO.MemoryStream();
            this.WriteXmlSchema(new System.Xml.XmlTextWriter(stream, null));
            stream.Position = 0;
            return System.Xml.Schema.XmlSchema.Read(new System.Xml.XmlTextReader(stream), null);
        }
        
        internal void InitVars() {
            this.InitVars(true);
        }
        
        internal void InitVars(bool initTable) {
            this.tableContact = ((ContactDataTable)(base.Tables["Contact"]));
            if ((initTable == true)) {
                if ((this.tableContact != null)) {
                    this.tableContact.InitVars();
                }
            }
        }
        
        private void InitClass() {
            this.DataSetName = "AdventureWorksDataSet";
            this.Prefix = "";
            this.Namespace = "http://tempuri.org/AdventureWorksDataSet.xsd";
            this.EnforceConstraints = true;
            this.tableContact = new ContactDataTable();
            base.Tables.Add(this.tableContact);
        }
        
        private bool ShouldSerializeContact() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
            AdventureWorksDataSet ds = new AdventureWorksDataSet();
            System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
            System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
            xs.Add(ds.GetSchemaSerializable());
            System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            return type;
        }
        
        public delegate void ContactRowChangeEventHandler(object sender, ContactRowChangeEvent e);
        
        [System.Serializable()]
        [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
        public partial class ContactDataTable : System.Data.DataTable, System.Collections.IEnumerable {
            
            private System.Data.DataColumn columnContactID;
            
            private System.Data.DataColumn columnNameStyle;
            
            private System.Data.DataColumn columnTitle;
            
            private System.Data.DataColumn columnFirstName;
            
            private System.Data.DataColumn columnMiddleName;
            
            private System.Data.DataColumn columnLastName;
            
            private System.Data.DataColumn columnSuffix;
            
            private System.Data.DataColumn columnEmailAddress;
            
            private System.Data.DataColumn columnEmailPromotion;
            
            private System.Data.DataColumn columnPhone;
            
            private System.Data.DataColumn columnPasswordHash;
            
            private System.Data.DataColumn columnPasswordSalt;
            
            private System.Data.DataColumn columnAdditionalContactInfo;
            
            private System.Data.DataColumn columnrowguid;
            
            private System.Data.DataColumn columnModifiedDate;
            
            public ContactDataTable() {
                this.TableName = "Contact";
                this.BeginInit();
                this.InitClass();
                this.EndInit();
            }
            
            internal ContactDataTable(System.Data.DataTable table) {
                this.TableName = table.TableName;
                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                    this.CaseSensitive = table.CaseSensitive;
                }
                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                    this.Locale = table.Locale;
                }
                if ((table.Namespace != table.DataSet.Namespace)) {
                    this.Namespace = table.Namespace;
                }
                this.Prefix = table.Prefix;
                this.MinimumCapacity = table.MinimumCapacity;
            }
            
            protected ContactDataTable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                    base(info, context) {
                this.InitVars();
            }
            
            public System.Data.DataColumn ContactIDColumn {
                get {
                    return this.columnContactID;
                }
            }
            
            public System.Data.DataColumn NameStyleColumn {
                get {
                    return this.columnNameStyle;
                }
            }
            
            public System.Data.DataColumn TitleColumn {
                get {
                    return this.columnTitle;
                }
            }
            
            public System.Data.DataColumn FirstNameColumn {
                get {
                    return this.columnFirstName;
                }
            }
            
            public System.Data.DataColumn MiddleNameColumn {
                get {
                    return this.columnMiddleName;
                }
            }
            
            public System.Data.DataColumn LastNameColumn {
                get {
                    return this.columnLastName;
                }
            }
            
            public System.Data.DataColumn SuffixColumn {
                get {
                    return this.columnSuffix;
                }
            }
            
            public System.Data.DataColumn EmailAddressColumn {
                get {
                    return this.columnEmailAddress;
                }
            }
            
            public System.Data.DataColumn EmailPromotionColumn {
                get {
                    return this.columnEmailPromotion;
                }
            }
            
            public System.Data.DataColumn PhoneColumn {
                get {
                    return this.columnPhone;
                }
            }
            
            public System.Data.DataColumn PasswordHashColumn {
                get {
                    return this.columnPasswordHash;
                }
            }
            
            public System.Data.DataColumn PasswordSaltColumn {
                get {
                    return this.columnPasswordSalt;
                }
            }
            
            public System.Data.DataColumn AdditionalContactInfoColumn {
                get {
                    return this.columnAdditionalContactInfo;
                }
            }
            
            public System.Data.DataColumn rowguidColumn {
                get {
                    return this.columnrowguid;
                }
            }
            
            public System.Data.DataColumn ModifiedDateColumn {
                get {
                    return this.columnModifiedDate;
                }
            }
            
            [System.ComponentModel.Browsable(false)]
            public int Count {
                get {
                    return this.Rows.Count;
                }
            }
            
            public ContactRow this[int index] {
                get {
                    return ((ContactRow)(this.Rows[index]));
                }
            }
            
            public event ContactRowChangeEventHandler ContactRowChanged;
            
            public event ContactRowChangeEventHandler ContactRowChanging;
            
            public event ContactRowChangeEventHandler ContactRowDeleted;
            
            public event ContactRowChangeEventHandler ContactRowDeleting;
            
            public void AddContactRow(ContactRow row) {
                this.Rows.Add(row);
            }
            
            public ContactRow AddContactRow(bool NameStyle, string Title, string FirstName, string MiddleName, string LastName, string Suffix, string EmailAddress, int EmailPromotion, string Phone, string PasswordHash, string PasswordSalt, string AdditionalContactInfo, System.Guid rowguid, System.DateTime ModifiedDate) {
                ContactRow rowContactRow = ((ContactRow)(this.NewRow()));
                rowContactRow.ItemArray = new object[] {
                        null,
                        NameStyle,
                        Title,
                        FirstName,
                        MiddleName,
                        LastName,
                        Suffix,
                        EmailAddress,
                        EmailPromotion,
                        Phone,
                        PasswordHash,
                        PasswordSalt,
                        AdditionalContactInfo,
                        rowguid,
                        ModifiedDate};
                this.Rows.Add(rowContactRow);
                return rowContactRow;
            }
            
            public ContactRow FindByContactID(int ContactID) {
                return ((ContactRow)(this.Rows.Find(new object[] {
                            ContactID})));
            }
            
            public virtual System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override System.Data.DataTable Clone() {
                ContactDataTable cln = ((ContactDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override System.Data.DataTable CreateInstance() {
                return new ContactDataTable();
            }
            
            internal void InitVars() {
                this.columnContactID = base.Columns["ContactID"];
                this.columnNameStyle = base.Columns["NameStyle"];
                this.columnTitle = base.Columns["Title"];
                this.columnFirstName = base.Columns["FirstName"];
                this.columnMiddleName = base.Columns["MiddleName"];
                this.columnLastName = base.Columns["LastName"];
                this.columnSuffix = base.Columns["Suffix"];
                this.columnEmailAddress = base.Columns["EmailAddress"];
                this.columnEmailPromotion = base.Columns["EmailPromotion"];
                this.columnPhone = base.Columns["Phone"];
                this.columnPasswordHash = base.Columns["PasswordHash"];
                this.columnPasswordSalt = base.Columns["PasswordSalt"];
                this.columnAdditionalContactInfo = base.Columns["AdditionalContactInfo"];
                this.columnrowguid = base.Columns["rowguid"];
                this.columnModifiedDate = base.Columns["ModifiedDate"];
            }
            
            private void InitClass() {
                this.columnContactID = new System.Data.DataColumn("ContactID", typeof(int), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnContactID);
                this.columnNameStyle = new System.Data.DataColumn("NameStyle", typeof(bool), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnNameStyle);
                this.columnTitle = new System.Data.DataColumn("Title", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnTitle);
                this.columnFirstName = new System.Data.DataColumn("FirstName", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnFirstName);
                this.columnMiddleName = new System.Data.DataColumn("MiddleName", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnMiddleName);
                this.columnLastName = new System.Data.DataColumn("LastName", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnLastName);
                this.columnSuffix = new System.Data.DataColumn("Suffix", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnSuffix);
                this.columnEmailAddress = new System.Data.DataColumn("EmailAddress", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnEmailAddress);
                this.columnEmailPromotion = new System.Data.DataColumn("EmailPromotion", typeof(int), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnEmailPromotion);
                this.columnPhone = new System.Data.DataColumn("Phone", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnPhone);
                this.columnPasswordHash = new System.Data.DataColumn("PasswordHash", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnPasswordHash);
                this.columnPasswordSalt = new System.Data.DataColumn("PasswordSalt", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnPasswordSalt);
                this.columnAdditionalContactInfo = new System.Data.DataColumn("AdditionalContactInfo", typeof(string), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnAdditionalContactInfo);
                this.columnrowguid = new System.Data.DataColumn("rowguid", typeof(System.Guid), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnrowguid);
                this.columnModifiedDate = new System.Data.DataColumn("ModifiedDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                base.Columns.Add(this.columnModifiedDate);
                this.Constraints.Add(new System.Data.UniqueConstraint("Constraint1", new System.Data.DataColumn[] {
                                this.columnContactID}, true));
                this.columnContactID.AutoIncrement = true;
                this.columnContactID.AllowDBNull = false;
                this.columnContactID.ReadOnly = true;
                this.columnContactID.Unique = true;
                this.columnNameStyle.AllowDBNull = false;
                this.columnTitle.MaxLength = 8;
                this.columnFirstName.AllowDBNull = false;
                this.columnFirstName.MaxLength = 50;
                this.columnMiddleName.MaxLength = 50;
                this.columnLastName.AllowDBNull = false;
                this.columnLastName.MaxLength = 50;
                this.columnSuffix.MaxLength = 10;
                this.columnEmailAddress.MaxLength = 50;
                this.columnEmailPromotion.AllowDBNull = false;
                this.columnPhone.MaxLength = 25;
                this.columnPasswordHash.AllowDBNull = false;
                this.columnPasswordHash.MaxLength = 40;
                this.columnPasswordSalt.AllowDBNull = false;
                this.columnPasswordSalt.MaxLength = 10;
                this.columnAdditionalContactInfo.MaxLength = 2147483647;
                this.columnrowguid.AllowDBNull = false;
                this.columnModifiedDate.AllowDBNull = false;
            }
            
            public ContactRow NewContactRow() {
                return ((ContactRow)(this.NewRow()));
            }
            
            protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) {
                return new ContactRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ContactRow);
            }
            
            protected override void OnRowChanged(System.Data.DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ContactRowChanged != null)) {
                    this.ContactRowChanged(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(System.Data.DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ContactRowChanging != null)) {
                    this.ContactRowChanging(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ContactRowDeleted != null)) {
                    this.ContactRowDeleted(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ContactRowDeleting != null)) {
                    this.ContactRowDeleting(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveContactRow(ContactRow row) {
                this.Rows.Remove(row);
            }
            
            public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
                System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
                System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
                AdventureWorksDataSet ds = new AdventureWorksDataSet();
                xs.Add(ds.GetSchemaSerializable());
                System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs = new decimal(0);
                any1.MaxOccurs = decimal.MaxValue;
                any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs = new decimal(1);
                any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name = "tableTypeName";
                attribute2.FixedValue = "ContactDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                return type;
            }
        }
        
        public partial class ContactRow : System.Data.DataRow {
            
            private ContactDataTable tableContact;
            
            internal ContactRow(System.Data.DataRowBuilder rb) : 
                    base(rb) {
                this.tableContact = ((ContactDataTable)(this.Table));
            }
            
            public int ContactID {
                get {
                    return ((int)(this[this.tableContact.ContactIDColumn]));
                }
                set {
                    this[this.tableContact.ContactIDColumn] = value;
                }
            }
            
            public bool NameStyle {
                get {
                    return ((bool)(this[this.tableContact.NameStyleColumn]));
                }
                set {
                    this[this.tableContact.NameStyleColumn] = value;
                }
            }
            
            public string Title {
                get {
                    try {
                        return ((string)(this[this.tableContact.TitleColumn]));
                    }
                    catch (System.InvalidCastException e) {
                        throw new System.Data.StrongTypingException("The value for column \'Title\' in table \'Contact\' is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContact.TitleColumn] = value;
                }
            }
            
            public string FirstName {
                get {
                    return ((string)(this[this.tableContact.FirstNameColumn]));
                }
                set {
                    this[this.tableContact.FirstNameColumn] = value;
                }
            }
            
            public string MiddleName {
                get {
                    try {
                        return ((string)(this[this.tableContact.MiddleNameColumn]));
                    }
                    catch (System.InvalidCastException e) {
                        throw new System.Data.StrongTypingException("The value for column \'MiddleName\' in table \'Contact\' is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContact.MiddleNameColumn] = value;
                }
            }
            
            public string LastName {
                get {
                    return ((string)(this[this.tableContact.LastNameColumn]));
                }
                set {
                    this[this.tableContact.LastNameColumn] = value;
                }
            }
            
            public string Suffix {
                get {
                    try {
                        return ((string)(this[this.tableContact.SuffixColumn]));
                    }
                    catch (System.InvalidCastException e) {
                        throw new System.Data.StrongTypingException("The value for column \'Suffix\' in table \'Contact\' is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContact.SuffixColumn] = value;
                }
            }
            
            public string EmailAddress {
                get {
                    try {
                        return ((string)(this[this.tableContact.EmailAddressColumn]));
                    }
                    catch (System.InvalidCastException e) {
                        throw new System.Data.StrongTypingException("The value for column \'EmailAddress\' in table \'Contact\' is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContact.EmailAddressColumn] = value;
                }
            }
            
            public int EmailPromotion {
                get {
                    return ((int)(this[this.tableContact.EmailPromotionColumn]));
                }
                set {
                    this[this.tableContact.EmailPromotionColumn] = value;
                }
            }
            
            public string Phone {
                get {
                    try {
                        return ((string)(this[this.tableContact.PhoneColumn]));
                    }
                    catch (System.InvalidCastException e) {
                        throw new System.Data.StrongTypingException("The value for column \'Phone\' in table \'Contact\' is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContact.PhoneColumn] = value;
                }
            }
            
            public string PasswordHash {
                get {
                    return ((string)(this[this.tableContact.PasswordHashColumn]));
                }
                set {
                    this[this.tableContact.PasswordHashColumn] = value;
                }
            }
            
            public string PasswordSalt {
                get {
                    return ((string)(this[this.tableContact.PasswordSaltColumn]));
                }
                set {
                    this[this.tableContact.PasswordSaltColumn] = value;
                }
            }
            
            public string AdditionalContactInfo {
                get {
                    try {
                        return ((string)(this[this.tableContact.AdditionalContactInfoColumn]));
                    }
                    catch (System.InvalidCastException e) {
                        throw new System.Data.StrongTypingException("The value for column \'AdditionalContactInfo\' in table \'Contact\' is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContact.AdditionalContactInfoColumn] = value;
                }
            }
            
            public System.Guid rowguid {
                get {
                    return ((System.Guid)(this[this.tableContact.rowguidColumn]));
                }
                set {
                    this[this.tableContact.rowguidColumn] = value;
                }
            }
            
            public System.DateTime ModifiedDate {
                get {
                    return ((System.DateTime)(this[this.tableContact.ModifiedDateColumn]));
                }
                set {
                    this[this.tableContact.ModifiedDateColumn] = value;
                }
            }
            
            public bool IsTitleNull() {
                return this.IsNull(this.tableContact.TitleColumn);
            }
            
            public void SetTitleNull() {
                this[this.tableContact.TitleColumn] = System.Convert.DBNull;
            }
            
            public bool IsMiddleNameNull() {
                return this.IsNull(this.tableContact.MiddleNameColumn);
            }
            
            public void SetMiddleNameNull() {
                this[this.tableContact.MiddleNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsSuffixNull() {
                return this.IsNull(this.tableContact.SuffixColumn);
            }
            
            public void SetSuffixNull() {
                this[this.tableContact.SuffixColumn] = System.Convert.DBNull;
            }
            
            public bool IsEmailAddressNull() {
                return this.IsNull(this.tableContact.EmailAddressColumn);
            }
            
            public void SetEmailAddressNull() {
                this[this.tableContact.EmailAddressColumn] = System.Convert.DBNull;
            }
            
            public bool IsPhoneNull() {
                return this.IsNull(this.tableContact.PhoneColumn);
            }
            
            public void SetPhoneNull() {
                this[this.tableContact.PhoneColumn] = System.Convert.DBNull;
            }
            
            public bool IsAdditionalContactInfoNull() {
                return this.IsNull(this.tableContact.AdditionalContactInfoColumn);
            }
            
            public void SetAdditionalContactInfoNull() {
                this[this.tableContact.AdditionalContactInfoColumn] = System.Convert.DBNull;
            }
        }
        
        public class ContactRowChangeEvent : System.EventArgs {
            
            private ContactRow eventRow;
            
            private System.Data.DataRowAction eventAction;
            
            public ContactRowChangeEvent(ContactRow row, System.Data.DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ContactRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public System.Data.DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
namespace DataBindingsMsSQL.AdventureWorksDataSetTableAdapters {
    
    
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.ComponentModel.ToolboxItem(true)]
    [System.ComponentModel.DataObjectAttribute(true)]
    [System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
    [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
    public partial class ContactTableAdapter : System.ComponentModel.Component {
        
        private System.Data.SqlClient.SqlDataAdapter m_adapter;
        
        private System.Data.SqlClient.SqlConnection m_connection;
        
        private System.Data.SqlClient.SqlCommand[] m_commandCollection;
        
        private bool m_clearBeforeFill;
        
        public ContactTableAdapter() {
            this.m_clearBeforeFill = true;
        }
        
        private System.Data.SqlClient.SqlDataAdapter Adapter {
            get {
                if ((this.m_adapter == null)) {
                    this.InitAdapter();
                }
                return this.m_adapter;
            }
        }
        
        internal System.Data.SqlClient.SqlConnection Connection {
            get {
                if ((this.m_connection == null)) {
                    this.InitConnection();
                }
                return this.m_connection;
            }
            set {
                this.m_connection = value;
                if ((this.Adapter.InsertCommand != null)) {
                    this.Adapter.InsertCommand.Connection = value;
                }
                if ((this.Adapter.DeleteCommand != null)) {
                    this.Adapter.DeleteCommand.Connection = value;
                }
                if ((this.Adapter.UpdateCommand != null)) {
                    this.Adapter.UpdateCommand.Connection = value;
                }
                for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
                    if ((this.CommandCollection[i] != null)) {
                        ((System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
                    }
                }
            }
        }
        
        protected System.Data.SqlClient.SqlCommand[] CommandCollection {
            get {
                if ((this.m_commandCollection == null)) {
                    this.InitCommandCollection();
                }
                return this.m_commandCollection;
            }
        }
        
        public bool ClearBeforeFill {
            get {
                return this.m_clearBeforeFill;
            }
            set {
                this.m_clearBeforeFill = value;
            }
        }
        
        private void InitAdapter() {
            this.m_adapter = new System.Data.SqlClient.SqlDataAdapter();
            System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "Contact";
            tableMapping.ColumnMappings.Add("ContactID", "ContactID");
            tableMapping.ColumnMappings.Add("NameStyle", "NameStyle");
            tableMapping.ColumnMappings.Add("Title", "Title");
            tableMapping.ColumnMappings.Add("FirstName", "FirstName");
            tableMapping.ColumnMappings.Add("MiddleName", "MiddleName");
            tableMapping.ColumnMappings.Add("LastName", "LastName");
            tableMapping.ColumnMappings.Add("Suffix", "Suffix");
            tableMapping.ColumnMappings.Add("EmailAddress", "EmailAddress");
            tableMapping.ColumnMappings.Add("EmailPromotion", "EmailPromotion");
            tableMapping.ColumnMappings.Add("Phone", "Phone");
            tableMapping.ColumnMappings.Add("PasswordHash", "PasswordHash");
            tableMapping.ColumnMappings.Add("PasswordSalt", "PasswordSalt");
            tableMapping.ColumnMappings.Add("AdditionalContactInfo", "AdditionalContactInfo");
            tableMapping.ColumnMappings.Add("rowguid", "rowguid");
            tableMapping.ColumnMappings.Add("ModifiedDate", "ModifiedDate");
            this.m_adapter.TableMappings.Add(tableMapping);
            this.m_adapter.DeleteCommand = new System.Data.SqlClient.SqlCommand();
            this.m_adapter.DeleteCommand.Connection = this.Connection;
            this.m_adapter.DeleteCommand.CommandText = @"DELETE FROM [Person].[Contact] WHERE (([ContactID] = @Original_ContactID) AND ([NameStyle] = @Original_NameStyle) AND ((@IsNull_Title = 1 AND [Title] IS NULL) OR ([Title] = @Original_Title)) AND ([FirstName] = @Original_FirstName) AND ((@IsNull_MiddleName = 1 AND [MiddleName] IS NULL) OR ([MiddleName] = @Original_MiddleName)) AND ([LastName] = @Original_LastName) AND ((@IsNull_Suffix = 1 AND [Suffix] IS NULL) OR ([Suffix] = @Original_Suffix)) AND ((@IsNull_EmailAddress = 1 AND [EmailAddress] IS NULL) OR ([EmailAddress] = @Original_EmailAddress)) AND ([EmailPromotion] = @Original_EmailPromotion) AND ((@IsNull_Phone = 1 AND [Phone] IS NULL) OR ([Phone] = @Original_Phone)) AND ([PasswordHash] = @Original_PasswordHash) AND ([PasswordSalt] = @Original_PasswordSalt) AND ([rowguid] = @Original_rowguid) AND ([ModifiedDate] = @Original_ModifiedDate))";
            this.m_adapter.DeleteCommand.CommandType = System.Data.CommandType.Text;
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ContactID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ContactID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_NameStyle", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "NameStyle", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Title", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Title", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Title", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Title", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_FirstName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "FirstName", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_MiddleName", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "MiddleName", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MiddleName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "MiddleName", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_LastName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "LastName", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Suffix", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Suffix", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Suffix", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Suffix", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_EmailAddress", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_EmailAddress", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_EmailPromotion", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailPromotion", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Phone", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Phone", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Phone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Phone", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PasswordHash", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordHash", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PasswordSalt", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordSalt", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_rowguid", System.Data.SqlDbType.UniqueIdentifier, 0, System.Data.ParameterDirection.Input, 0, 0, "rowguid", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ModifiedDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "ModifiedDate", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.InsertCommand = new System.Data.SqlClient.SqlCommand();
            this.m_adapter.InsertCommand.Connection = this.Connection;
            this.m_adapter.InsertCommand.CommandText = @"INSERT INTO [Person].[Contact] ([NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [EmailAddress], [EmailPromotion], [Phone], [PasswordHash], [PasswordSalt], [AdditionalContactInfo], [rowguid], [ModifiedDate]) VALUES (@NameStyle, @Title, @FirstName, @MiddleName, @LastName, @Suffix, @EmailAddress, @EmailPromotion, @Phone, @PasswordHash, @PasswordSalt, @AdditionalContactInfo, @rowguid, @ModifiedDate);
SELECT ContactID, NameStyle, Title, FirstName, MiddleName, LastName, Suffix, EmailAddress, EmailPromotion, Phone, PasswordHash, PasswordSalt, AdditionalContactInfo, rowguid, ModifiedDate FROM Person.Contact WHERE (ContactID = @@IDENTITY)";
            this.m_adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NameStyle", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "NameStyle", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Title", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Title", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FirstName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "FirstName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MiddleName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "MiddleName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "LastName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Suffix", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Suffix", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EmailAddress", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EmailPromotion", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailPromotion", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Phone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Phone", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PasswordHash", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordHash", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PasswordSalt", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordSalt", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AdditionalContactInfo", System.Data.SqlDbType.Xml, 0, System.Data.ParameterDirection.Input, 0, 0, "AdditionalContactInfo", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@rowguid", System.Data.SqlDbType.UniqueIdentifier, 0, System.Data.ParameterDirection.Input, 0, 0, "rowguid", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ModifiedDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "ModifiedDate", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand = new System.Data.SqlClient.SqlCommand();
            this.m_adapter.UpdateCommand.Connection = this.Connection;
            this.m_adapter.UpdateCommand.CommandText = @"UPDATE [Person].[Contact] SET [NameStyle] = @NameStyle, [Title] = @Title, [FirstName] = @FirstName, [MiddleName] = @MiddleName, [LastName] = @LastName, [Suffix] = @Suffix, [EmailAddress] = @EmailAddress, [EmailPromotion] = @EmailPromotion, [Phone] = @Phone, [PasswordHash] = @PasswordHash, [PasswordSalt] = @PasswordSalt, [AdditionalContactInfo] = @AdditionalContactInfo, [rowguid] = @rowguid, [ModifiedDate] = @ModifiedDate WHERE (([ContactID] = @Original_ContactID) AND ([NameStyle] = @Original_NameStyle) AND ((@IsNull_Title = 1 AND [Title] IS NULL) OR ([Title] = @Original_Title)) AND ([FirstName] = @Original_FirstName) AND ((@IsNull_MiddleName = 1 AND [MiddleName] IS NULL) OR ([MiddleName] = @Original_MiddleName)) AND ([LastName] = @Original_LastName) AND ((@IsNull_Suffix = 1 AND [Suffix] IS NULL) OR ([Suffix] = @Original_Suffix)) AND ((@IsNull_EmailAddress = 1 AND [EmailAddress] IS NULL) OR ([EmailAddress] = @Original_EmailAddress)) AND ([EmailPromotion] = @Original_EmailPromotion) AND ((@IsNull_Phone = 1 AND [Phone] IS NULL) OR ([Phone] = @Original_Phone)) AND ([PasswordHash] = @Original_PasswordHash) AND ([PasswordSalt] = @Original_PasswordSalt) AND ([rowguid] = @Original_rowguid) AND ([ModifiedDate] = @Original_ModifiedDate));
SELECT ContactID, NameStyle, Title, FirstName, MiddleName, LastName, Suffix, EmailAddress, EmailPromotion, Phone, PasswordHash, PasswordSalt, AdditionalContactInfo, rowguid, ModifiedDate FROM Person.Contact WHERE (ContactID = @ContactID)";
            this.m_adapter.UpdateCommand.CommandType = System.Data.CommandType.Text;
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@NameStyle", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "NameStyle", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Title", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Title", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FirstName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "FirstName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MiddleName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "MiddleName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "LastName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Suffix", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Suffix", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EmailAddress", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EmailPromotion", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailPromotion", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Phone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Phone", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PasswordHash", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordHash", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PasswordSalt", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordSalt", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AdditionalContactInfo", System.Data.SqlDbType.Xml, 0, System.Data.ParameterDirection.Input, 0, 0, "AdditionalContactInfo", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@rowguid", System.Data.SqlDbType.UniqueIdentifier, 0, System.Data.ParameterDirection.Input, 0, 0, "rowguid", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ModifiedDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "ModifiedDate", System.Data.DataRowVersion.Current, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ContactID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ContactID", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_NameStyle", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, 0, 0, "NameStyle", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Title", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Title", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Title", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Title", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_FirstName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "FirstName", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_MiddleName", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "MiddleName", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_MiddleName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "MiddleName", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_LastName", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "LastName", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Suffix", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Suffix", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Suffix", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Suffix", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_EmailAddress", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_EmailAddress", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_EmailPromotion", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmailPromotion", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Phone", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Phone", System.Data.DataRowVersion.Original, true, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Phone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Phone", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PasswordHash", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordHash", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PasswordSalt", System.Data.SqlDbType.VarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PasswordSalt", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_rowguid", System.Data.SqlDbType.UniqueIdentifier, 0, System.Data.ParameterDirection.Input, 0, 0, "rowguid", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ModifiedDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "ModifiedDate", System.Data.DataRowVersion.Original, false, null, "", "", ""));
            this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ContactID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, 0, 0, "ContactID", System.Data.DataRowVersion.Current, false, null, "", "", ""));
        }
        
        private void InitConnection() {
            this.m_connection = new System.Data.SqlClient.SqlConnection();
            this.m_connection.ConnectionString = DataBindingsMsSQL.Properties.Settings.Default.AdventureWorksConnectionString;
        }
        
        private void InitCommandCollection() {
            this.m_commandCollection = new System.Data.SqlClient.SqlCommand[1];
            this.m_commandCollection[0] = new System.Data.SqlClient.SqlCommand();
            this.m_commandCollection[0].Connection = this.Connection;
            this.m_commandCollection[0].CommandText = "SELECT ContactID, NameStyle, Title, FirstName, MiddleName, LastName, Suffix, Emai" +
                "lAddress, EmailPromotion, Phone, PasswordHash, PasswordSalt, AdditionalContactIn" +
                "fo, rowguid, ModifiedDate FROM Person.Contact";
            this.m_commandCollection[0].CommandType = System.Data.CommandType.Text;
        }
        
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
        public virtual int Fill(AdventureWorksDataSet.ContactDataTable dataTable) {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            if ((this.m_clearBeforeFill == true)) {
                dataTable.Clear();
            }
            int returnValue = this.Adapter.Fill(dataTable);
            return returnValue;
        }
        
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
        public virtual AdventureWorksDataSet.ContactDataTable GetData() {
            this.Adapter.SelectCommand = this.CommandCollection[0];
            AdventureWorksDataSet.ContactDataTable dataTable = new AdventureWorksDataSet.ContactDataTable();
            this.Adapter.Fill(dataTable);
            return dataTable;
        }
        
        public virtual int Update(AdventureWorksDataSet.ContactDataTable dataTable) {
            return this.Adapter.Update(dataTable);
        }
        
        public virtual int Update(AdventureWorksDataSet dataSet) {
            return this.Adapter.Update(dataSet, "Contact");
        }
        
        public virtual int Update(System.Data.DataRow dataRow) {
            return this.Adapter.Update(new System.Data.DataRow[] {
                        dataRow});
        }
        
        public virtual int Update(System.Data.DataRow[] dataRows) {
            return this.Adapter.Update(dataRows);
        }
        
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
        public virtual int Delete(int Original_ContactID, bool Original_NameStyle, string Original_Title, string Original_FirstName, string Original_MiddleName, string Original_LastName, string Original_Suffix, string Original_EmailAddress, int Original_EmailPromotion, string Original_Phone, string Original_PasswordHash, string Original_PasswordSalt, System.Guid Original_rowguid, System.DateTime Original_ModifiedDate) {
            this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ContactID));
            this.Adapter.DeleteCommand.Parameters[1].Value = ((bool)(Original_NameStyle));
            if ((Original_Title == null)) {
                this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(1));
                this.Adapter.DeleteCommand.Parameters[3].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(0));
                this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_Title));
            }
            if ((Original_FirstName == null)) {
                throw new System.ArgumentNullException("Original_FirstName");
            }
            else {
                this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_FirstName));
            }
            if ((Original_MiddleName == null)) {
                this.Adapter.DeleteCommand.Parameters[5].Value = ((int)(1));
                this.Adapter.DeleteCommand.Parameters[6].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[5].Value = ((int)(0));
                this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_MiddleName));
            }
            if ((Original_LastName == null)) {
                throw new System.ArgumentNullException("Original_LastName");
            }
            else {
                this.Adapter.DeleteCommand.Parameters[7].Value = ((string)(Original_LastName));
            }
            if ((Original_Suffix == null)) {
                this.Adapter.DeleteCommand.Parameters[8].Value = ((int)(1));
                this.Adapter.DeleteCommand.Parameters[9].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[8].Value = ((int)(0));
                this.Adapter.DeleteCommand.Parameters[9].Value = ((string)(Original_Suffix));
            }
            if ((Original_EmailAddress == null)) {
                this.Adapter.DeleteCommand.Parameters[10].Value = ((int)(1));
                this.Adapter.DeleteCommand.Parameters[11].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[10].Value = ((int)(0));
                this.Adapter.DeleteCommand.Parameters[11].Value = ((string)(Original_EmailAddress));
            }
            this.Adapter.DeleteCommand.Parameters[12].Value = ((int)(Original_EmailPromotion));
            if ((Original_Phone == null)) {
                this.Adapter.DeleteCommand.Parameters[13].Value = ((int)(1));
                this.Adapter.DeleteCommand.Parameters[14].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.DeleteCommand.Parameters[13].Value = ((int)(0));
                this.Adapter.DeleteCommand.Parameters[14].Value = ((string)(Original_Phone));
            }
            if ((Original_PasswordHash == null)) {
                throw new System.ArgumentNullException("Original_PasswordHash");
            }
            else {
                this.Adapter.DeleteCommand.Parameters[15].Value = ((string)(Original_PasswordHash));
            }
            if ((Original_PasswordSalt == null)) {
                throw new System.ArgumentNullException("Original_PasswordSalt");
            }
            else {
                this.Adapter.DeleteCommand.Parameters[16].Value = ((string)(Original_PasswordSalt));
            }
            this.Adapter.DeleteCommand.Parameters[17].Value = ((System.Guid)(Original_rowguid));
            this.Adapter.DeleteCommand.Parameters[18].Value = ((System.DateTime)(Original_ModifiedDate));
            System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State;
            this.Adapter.DeleteCommand.Connection.Open();
            try {
                return this.Adapter.DeleteCommand.ExecuteNonQuery();
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.DeleteCommand.Connection.Close();
                }
            }
        }
        
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
        public virtual int Insert(bool NameStyle, string Title, string FirstName, string MiddleName, string LastName, string Suffix, string EmailAddress, int EmailPromotion, string Phone, string PasswordHash, string PasswordSalt, object AdditionalContactInfo, System.Guid rowguid, System.DateTime ModifiedDate) {
            this.Adapter.InsertCommand.Parameters[0].Value = ((bool)(NameStyle));
            if ((Title == null)) {
                this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Title));
            }
            if ((FirstName == null)) {
                throw new System.ArgumentNullException("FirstName");
            }
            else {
                this.Adapter.InsertCommand.Parameters[2].Value = ((string)(FirstName));
            }
            if ((MiddleName == null)) {
                this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[3].Value = ((string)(MiddleName));
            }
            if ((LastName == null)) {
                throw new System.ArgumentNullException("LastName");
            }
            else {
                this.Adapter.InsertCommand.Parameters[4].Value = ((string)(LastName));
            }
            if ((Suffix == null)) {
                this.Adapter.InsertCommand.Parameters[5].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[5].Value = ((string)(Suffix));
            }
            if ((EmailAddress == null)) {
                this.Adapter.InsertCommand.Parameters[6].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[6].Value = ((string)(EmailAddress));
            }
            this.Adapter.InsertCommand.Parameters[7].Value = ((int)(EmailPromotion));
            if ((Phone == null)) {
                this.Adapter.InsertCommand.Parameters[8].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[8].Value = ((string)(Phone));
            }
            if ((PasswordHash == null)) {
                throw new System.ArgumentNullException("PasswordHash");
            }
            else {
                this.Adapter.InsertCommand.Parameters[9].Value = ((string)(PasswordHash));
            }
            if ((PasswordSalt == null)) {
                throw new System.ArgumentNullException("PasswordSalt");
            }
            else {
                this.Adapter.InsertCommand.Parameters[10].Value = ((string)(PasswordSalt));
            }
            if ((AdditionalContactInfo == null)) {
                this.Adapter.InsertCommand.Parameters[11].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.InsertCommand.Parameters[11].Value = ((object)(AdditionalContactInfo));
            }
            this.Adapter.InsertCommand.Parameters[12].Value = ((System.Guid)(rowguid));
            this.Adapter.InsertCommand.Parameters[13].Value = ((System.DateTime)(ModifiedDate));
            System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
            this.Adapter.InsertCommand.Connection.Open();
            try {
                return this.Adapter.InsertCommand.ExecuteNonQuery();
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.InsertCommand.Connection.Close();
                }
            }
        }
        
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
        public virtual int Update(
                    bool NameStyle, 
                    string Title, 
                    string FirstName, 
                    string MiddleName, 
                    string LastName, 
                    string Suffix, 
                    string EmailAddress, 
                    int EmailPromotion, 
                    string Phone, 
                    string PasswordHash, 
                    string PasswordSalt, 
                    object AdditionalContactInfo, 
                    System.Guid rowguid, 
                    System.DateTime ModifiedDate, 
                    int Original_ContactID, 
                    bool Original_NameStyle, 
                    string Original_Title, 
                    string Original_FirstName, 
                    string Original_MiddleName, 
                    string Original_LastName, 
                    string Original_Suffix, 
                    string Original_EmailAddress, 
                    int Original_EmailPromotion, 
                    string Original_Phone, 
                    string Original_PasswordHash, 
                    string Original_PasswordSalt, 
                    System.Guid Original_rowguid, 
                    System.DateTime Original_ModifiedDate, 
                    int ContactID) {
            this.Adapter.UpdateCommand.Parameters[0].Value = ((bool)(NameStyle));
            if ((Title == null)) {
                this.Adapter.UpdateCommand.Parameters[1].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Title));
            }
            if ((FirstName == null)) {
                throw new System.ArgumentNullException("FirstName");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(FirstName));
            }
            if ((MiddleName == null)) {
                this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(MiddleName));
            }
            if ((LastName == null)) {
                throw new System.ArgumentNullException("LastName");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(LastName));
            }
            if ((Suffix == null)) {
                this.Adapter.UpdateCommand.Parameters[5].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Suffix));
            }
            if ((EmailAddress == null)) {
                this.Adapter.UpdateCommand.Parameters[6].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(EmailAddress));
            }
            this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(EmailPromotion));
            if ((Phone == null)) {
                this.Adapter.UpdateCommand.Parameters[8].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Phone));
            }
            if ((PasswordHash == null)) {
                throw new System.ArgumentNullException("PasswordHash");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(PasswordHash));
            }
            if ((PasswordSalt == null)) {
                throw new System.ArgumentNullException("PasswordSalt");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(PasswordSalt));
            }
            if ((AdditionalContactInfo == null)) {
                this.Adapter.UpdateCommand.Parameters[11].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(AdditionalContactInfo));
            }
            this.Adapter.UpdateCommand.Parameters[12].Value = ((System.Guid)(rowguid));
            this.Adapter.UpdateCommand.Parameters[13].Value = ((System.DateTime)(ModifiedDate));
            this.Adapter.UpdateCommand.Parameters[14].Value = ((int)(Original_ContactID));
            this.Adapter.UpdateCommand.Parameters[15].Value = ((bool)(Original_NameStyle));
            if ((Original_Title == null)) {
                this.Adapter.UpdateCommand.Parameters[16].Value = ((int)(1));
                this.Adapter.UpdateCommand.Parameters[17].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[16].Value = ((int)(0));
                this.Adapter.UpdateCommand.Parameters[17].Value = ((string)(Original_Title));
            }
            if ((Original_FirstName == null)) {
                throw new System.ArgumentNullException("Original_FirstName");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[18].Value = ((string)(Original_FirstName));
            }
            if ((Original_MiddleName == null)) {
                this.Adapter.UpdateCommand.Parameters[19].Value = ((int)(1));
                this.Adapter.UpdateCommand.Parameters[20].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[19].Value = ((int)(0));
                this.Adapter.UpdateCommand.Parameters[20].Value = ((string)(Original_MiddleName));
            }
            if ((Original_LastName == null)) {
                throw new System.ArgumentNullException("Original_LastName");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[21].Value = ((string)(Original_LastName));
            }
            if ((Original_Suffix == null)) {
                this.Adapter.UpdateCommand.Parameters[22].Value = ((int)(1));
                this.Adapter.UpdateCommand.Parameters[23].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[22].Value = ((int)(0));
                this.Adapter.UpdateCommand.Parameters[23].Value = ((string)(Original_Suffix));
            }
            if ((Original_EmailAddress == null)) {
                this.Adapter.UpdateCommand.Parameters[24].Value = ((int)(1));
                this.Adapter.UpdateCommand.Parameters[25].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[24].Value = ((int)(0));
                this.Adapter.UpdateCommand.Parameters[25].Value = ((string)(Original_EmailAddress));
            }
            this.Adapter.UpdateCommand.Parameters[26].Value = ((int)(Original_EmailPromotion));
            if ((Original_Phone == null)) {
                this.Adapter.UpdateCommand.Parameters[27].Value = ((int)(1));
                this.Adapter.UpdateCommand.Parameters[28].Value = System.DBNull.Value;
            }
            else {
                this.Adapter.UpdateCommand.Parameters[27].Value = ((int)(0));
                this.Adapter.UpdateCommand.Parameters[28].Value = ((string)(Original_Phone));
            }
            if ((Original_PasswordHash == null)) {
                throw new System.ArgumentNullException("Original_PasswordHash");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[29].Value = ((string)(Original_PasswordHash));
            }
            if ((Original_PasswordSalt == null)) {
                throw new System.ArgumentNullException("Original_PasswordSalt");
            }
            else {
                this.Adapter.UpdateCommand.Parameters[30].Value = ((string)(Original_PasswordSalt));
            }
            this.Adapter.UpdateCommand.Parameters[31].Value = ((System.Guid)(Original_rowguid));
            this.Adapter.UpdateCommand.Parameters[32].Value = ((System.DateTime)(Original_ModifiedDate));
            this.Adapter.UpdateCommand.Parameters[33].Value = ((int)(ContactID));
            System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State;
            this.Adapter.UpdateCommand.Connection.Open();
            try {
                return this.Adapter.UpdateCommand.ExecuteNonQuery();
            }
            finally {
                if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
                    this.Adapter.UpdateCommand.Connection.Close();
                }
            }
        }
    }
}
