//------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ namespace StandardListControlsSample { using System; [Serializable()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.ToolboxItem(true)] [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] [System.Xml.Serialization.XmlRootAttribute("NorthwindDataSet")] [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage", "CA2240:ImplementISerializableCorrectly")] public partial class NorthwindDataSet : System.Data.DataSet { private EmployeesDataTable tableEmployees; private System.Data.DataRelation relationFK_Employees_Employees; private System.Data.SchemaSerializationMode _schemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public NorthwindDataSet() { 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 NorthwindDataSet(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["Employees"] != null)) { base.Tables.Add(new EmployeesDataTable(ds.Tables["Employees"])); } 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 EmployeesDataTable Employees { get { return this.tableEmployees; } } 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() { NorthwindDataSet cln = ((NorthwindDataSet)(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["Employees"] != null)) { base.Tables.Add(new EmployeesDataTable(ds.Tables["Employees"])); } 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.tableEmployees = ((EmployeesDataTable)(base.Tables["Employees"])); if ((initTable == true)) { if ((this.tableEmployees != null)) { this.tableEmployees.InitVars(); } } this.relationFK_Employees_Employees = this.Relations["FK_Employees_Employees"]; } private void InitClass() { this.DataSetName = "NorthwindDataSet"; this.Prefix = ""; this.Namespace = "http://tempuri.org/NorthwindDataSet.xsd"; this.EnforceConstraints = true; this.tableEmployees = new EmployeesDataTable(); base.Tables.Add(this.tableEmployees); this.relationFK_Employees_Employees = new System.Data.DataRelation("FK_Employees_Employees", new System.Data.DataColumn[] { this.tableEmployees.EmployeeIDColumn}, new System.Data.DataColumn[] { this.tableEmployees.ReportsToColumn}, false); this.Relations.Add(this.relationFK_Employees_Employees); } private bool ShouldSerializeEmployees() { 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) { NorthwindDataSet ds = new NorthwindDataSet(); 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 EmployeesRowChangeEventHandler(object sender, EmployeesRowChangeEvent e); [System.Serializable()] [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class EmployeesDataTable : System.Data.DataTable, System.Collections.IEnumerable { private System.Data.DataColumn columnEmployeeID; private System.Data.DataColumn columnLastName; private System.Data.DataColumn columnFirstName; private System.Data.DataColumn columnTitle; private System.Data.DataColumn columnTitleOfCourtesy; private System.Data.DataColumn columnBirthDate; private System.Data.DataColumn columnHireDate; private System.Data.DataColumn columnAddress; private System.Data.DataColumn columnCity; private System.Data.DataColumn columnRegion; private System.Data.DataColumn columnPostalCode; private System.Data.DataColumn columnCountry; private System.Data.DataColumn columnHomePhone; private System.Data.DataColumn columnExtension; private System.Data.DataColumn columnPhoto; private System.Data.DataColumn columnNotes; private System.Data.DataColumn columnReportsTo; private System.Data.DataColumn columnPhotoPath; public EmployeesDataTable() { this.TableName = "Employees"; this.BeginInit(); this.InitClass(); this.EndInit(); } internal EmployeesDataTable(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 EmployeesDataTable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } public System.Data.DataColumn EmployeeIDColumn { get { return this.columnEmployeeID; } } public System.Data.DataColumn LastNameColumn { get { return this.columnLastName; } } public System.Data.DataColumn FirstNameColumn { get { return this.columnFirstName; } } public System.Data.DataColumn TitleColumn { get { return this.columnTitle; } } public System.Data.DataColumn TitleOfCourtesyColumn { get { return this.columnTitleOfCourtesy; } } public System.Data.DataColumn BirthDateColumn { get { return this.columnBirthDate; } } public System.Data.DataColumn HireDateColumn { get { return this.columnHireDate; } } public System.Data.DataColumn AddressColumn { get { return this.columnAddress; } } public System.Data.DataColumn CityColumn { get { return this.columnCity; } } public System.Data.DataColumn RegionColumn { get { return this.columnRegion; } } public System.Data.DataColumn PostalCodeColumn { get { return this.columnPostalCode; } } public System.Data.DataColumn CountryColumn { get { return this.columnCountry; } } public System.Data.DataColumn HomePhoneColumn { get { return this.columnHomePhone; } } public System.Data.DataColumn ExtensionColumn { get { return this.columnExtension; } } public System.Data.DataColumn PhotoColumn { get { return this.columnPhoto; } } public System.Data.DataColumn NotesColumn { get { return this.columnNotes; } } public System.Data.DataColumn ReportsToColumn { get { return this.columnReportsTo; } } public System.Data.DataColumn PhotoPathColumn { get { return this.columnPhotoPath; } } [System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } public EmployeesRow this[int index] { get { return ((EmployeesRow)(this.Rows[index])); } } public event EmployeesRowChangeEventHandler EmployeesRowChanged; public event EmployeesRowChangeEventHandler EmployeesRowChanging; public event EmployeesRowChangeEventHandler EmployeesRowDeleted; public event EmployeesRowChangeEventHandler EmployeesRowDeleting; public void AddEmployeesRow(EmployeesRow row) { this.Rows.Add(row); } public EmployeesRow AddEmployeesRow( string LastName, string FirstName, string Title, string TitleOfCourtesy, System.DateTime BirthDate, System.DateTime HireDate, string Address, string City, string Region, string PostalCode, string Country, string HomePhone, string Extension, byte[] Photo, string Notes, EmployeesRow parentEmployeesRowByFK_Employees_Employees, string PhotoPath) { EmployeesRow rowEmployeesRow = ((EmployeesRow)(this.NewRow())); rowEmployeesRow.ItemArray = new object[] { null, LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, PostalCode, Country, HomePhone, Extension, Photo, Notes, parentEmployeesRowByFK_Employees_Employees[0], PhotoPath}; this.Rows.Add(rowEmployeesRow); return rowEmployeesRow; } public EmployeesRow FindByEmployeeID(int EmployeeID) { return ((EmployeesRow)(this.Rows.Find(new object[] { EmployeeID}))); } public virtual System.Collections.IEnumerator GetEnumerator() { return this.Rows.GetEnumerator(); } public override System.Data.DataTable Clone() { EmployeesDataTable cln = ((EmployeesDataTable)(base.Clone())); cln.InitVars(); return cln; } protected override System.Data.DataTable CreateInstance() { return new EmployeesDataTable(); } internal void InitVars() { this.columnEmployeeID = base.Columns["EmployeeID"]; this.columnLastName = base.Columns["LastName"]; this.columnFirstName = base.Columns["FirstName"]; this.columnTitle = base.Columns["Title"]; this.columnTitleOfCourtesy = base.Columns["TitleOfCourtesy"]; this.columnBirthDate = base.Columns["BirthDate"]; this.columnHireDate = base.Columns["HireDate"]; this.columnAddress = base.Columns["Address"]; this.columnCity = base.Columns["City"]; this.columnRegion = base.Columns["Region"]; this.columnPostalCode = base.Columns["PostalCode"]; this.columnCountry = base.Columns["Country"]; this.columnHomePhone = base.Columns["HomePhone"]; this.columnExtension = base.Columns["Extension"]; this.columnPhoto = base.Columns["Photo"]; this.columnNotes = base.Columns["Notes"]; this.columnReportsTo = base.Columns["ReportsTo"]; this.columnPhotoPath = base.Columns["PhotoPath"]; } private void InitClass() { this.columnEmployeeID = new System.Data.DataColumn("EmployeeID", typeof(int), null, System.Data.MappingType.Element); base.Columns.Add(this.columnEmployeeID); this.columnLastName = new System.Data.DataColumn("LastName", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnLastName); this.columnFirstName = new System.Data.DataColumn("FirstName", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnFirstName); this.columnTitle = new System.Data.DataColumn("Title", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnTitle); this.columnTitleOfCourtesy = new System.Data.DataColumn("TitleOfCourtesy", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnTitleOfCourtesy); this.columnBirthDate = new System.Data.DataColumn("BirthDate", typeof(System.DateTime), null, System.Data.MappingType.Element); base.Columns.Add(this.columnBirthDate); this.columnHireDate = new System.Data.DataColumn("HireDate", typeof(System.DateTime), null, System.Data.MappingType.Element); base.Columns.Add(this.columnHireDate); this.columnAddress = new System.Data.DataColumn("Address", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnAddress); this.columnCity = new System.Data.DataColumn("City", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnCity); this.columnRegion = new System.Data.DataColumn("Region", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnRegion); this.columnPostalCode = new System.Data.DataColumn("PostalCode", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnPostalCode); this.columnCountry = new System.Data.DataColumn("Country", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnCountry); this.columnHomePhone = new System.Data.DataColumn("HomePhone", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnHomePhone); this.columnExtension = new System.Data.DataColumn("Extension", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnExtension); this.columnPhoto = new System.Data.DataColumn("Photo", typeof(byte[]), null, System.Data.MappingType.Element); base.Columns.Add(this.columnPhoto); this.columnNotes = new System.Data.DataColumn("Notes", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnNotes); this.columnReportsTo = new System.Data.DataColumn("ReportsTo", typeof(int), null, System.Data.MappingType.Element); base.Columns.Add(this.columnReportsTo); this.columnPhotoPath = new System.Data.DataColumn("PhotoPath", typeof(string), null, System.Data.MappingType.Element); base.Columns.Add(this.columnPhotoPath); this.Constraints.Add(new System.Data.UniqueConstraint("Constraint1", new System.Data.DataColumn[] { this.columnEmployeeID}, true)); this.columnEmployeeID.AutoIncrement = true; this.columnEmployeeID.AllowDBNull = false; this.columnEmployeeID.ReadOnly = true; this.columnEmployeeID.Unique = true; this.columnLastName.AllowDBNull = false; this.columnLastName.MaxLength = 20; this.columnFirstName.AllowDBNull = false; this.columnFirstName.MaxLength = 10; this.columnTitle.MaxLength = 30; this.columnTitleOfCourtesy.MaxLength = 25; this.columnAddress.MaxLength = 60; this.columnCity.MaxLength = 15; this.columnRegion.MaxLength = 15; this.columnPostalCode.MaxLength = 10; this.columnCountry.MaxLength = 15; this.columnHomePhone.MaxLength = 24; this.columnExtension.MaxLength = 4; this.columnNotes.MaxLength = 1073741823; this.columnPhotoPath.MaxLength = 255; } public EmployeesRow NewEmployeesRow() { return ((EmployeesRow)(this.NewRow())); } protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) { return new EmployeesRow(builder); } protected override System.Type GetRowType() { return typeof(EmployeesRow); } protected override void OnRowChanged(System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.EmployeesRowChanged != null)) { this.EmployeesRowChanged(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action)); } } protected override void OnRowChanging(System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.EmployeesRowChanging != null)) { this.EmployeesRowChanging(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action)); } } protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.EmployeesRowDeleted != null)) { this.EmployeesRowDeleted(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action)); } } protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.EmployeesRowDeleting != null)) { this.EmployeesRowDeleting(this, new EmployeesRowChangeEvent(((EmployeesRow)(e.Row)), e.Action)); } } public void RemoveEmployeesRow(EmployeesRow 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(); NorthwindDataSet ds = new NorthwindDataSet(); 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 = "EmployeesDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; return type; } } public partial class EmployeesRow : System.Data.DataRow { private EmployeesDataTable tableEmployees; internal EmployeesRow(System.Data.DataRowBuilder rb) : base(rb) { this.tableEmployees = ((EmployeesDataTable)(this.Table)); } public int EmployeeID { get { return ((int)(this[this.tableEmployees.EmployeeIDColumn])); } set { this[this.tableEmployees.EmployeeIDColumn] = value; } } public string LastName { get { return ((string)(this[this.tableEmployees.LastNameColumn])); } set { this[this.tableEmployees.LastNameColumn] = value; } } public string FirstName { get { return ((string)(this[this.tableEmployees.FirstNameColumn])); } set { this[this.tableEmployees.FirstNameColumn] = value; } } public string Title { get { try { return ((string)(this[this.tableEmployees.TitleColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'Title\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.TitleColumn] = value; } } public string TitleOfCourtesy { get { try { return ((string)(this[this.tableEmployees.TitleOfCourtesyColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'TitleOfCourtesy\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.TitleOfCourtesyColumn] = value; } } public System.DateTime BirthDate { get { try { return ((System.DateTime)(this[this.tableEmployees.BirthDateColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'BirthDate\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.BirthDateColumn] = value; } } public System.DateTime HireDate { get { try { return ((System.DateTime)(this[this.tableEmployees.HireDateColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'HireDate\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.HireDateColumn] = value; } } public string Address { get { try { return ((string)(this[this.tableEmployees.AddressColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'Address\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.AddressColumn] = value; } } public string City { get { try { return ((string)(this[this.tableEmployees.CityColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'City\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.CityColumn] = value; } } public string Region { get { try { return ((string)(this[this.tableEmployees.RegionColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'Region\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.RegionColumn] = value; } } public string PostalCode { get { try { return ((string)(this[this.tableEmployees.PostalCodeColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'PostalCode\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.PostalCodeColumn] = value; } } public string Country { get { try { return ((string)(this[this.tableEmployees.CountryColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'Country\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.CountryColumn] = value; } } public string HomePhone { get { try { return ((string)(this[this.tableEmployees.HomePhoneColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'HomePhone\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.HomePhoneColumn] = value; } } public string Extension { get { try { return ((string)(this[this.tableEmployees.ExtensionColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'Extension\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.ExtensionColumn] = value; } } public byte[] Photo { get { try { return ((byte[])(this[this.tableEmployees.PhotoColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'Photo\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.PhotoColumn] = value; } } public string Notes { get { try { return ((string)(this[this.tableEmployees.NotesColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'Notes\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.NotesColumn] = value; } } public int ReportsTo { get { try { return ((int)(this[this.tableEmployees.ReportsToColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'ReportsTo\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.ReportsToColumn] = value; } } public string PhotoPath { get { try { return ((string)(this[this.tableEmployees.PhotoPathColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("The value for column \'PhotoPath\' in table \'Employees\' is DBNull.", e); } } set { this[this.tableEmployees.PhotoPathColumn] = value; } } public EmployeesRow EmployeesRowParent { get { return ((EmployeesRow)(this.GetParentRow(this.Table.ParentRelations["FK_Employees_Employees"]))); } set { this.SetParentRow(value, this.Table.ParentRelations["FK_Employees_Employees"]); } } public bool IsTitleNull() { return this.IsNull(this.tableEmployees.TitleColumn); } public void SetTitleNull() { this[this.tableEmployees.TitleColumn] = System.Convert.DBNull; } public bool IsTitleOfCourtesyNull() { return this.IsNull(this.tableEmployees.TitleOfCourtesyColumn); } public void SetTitleOfCourtesyNull() { this[this.tableEmployees.TitleOfCourtesyColumn] = System.Convert.DBNull; } public bool IsBirthDateNull() { return this.IsNull(this.tableEmployees.BirthDateColumn); } public void SetBirthDateNull() { this[this.tableEmployees.BirthDateColumn] = System.Convert.DBNull; } public bool IsHireDateNull() { return this.IsNull(this.tableEmployees.HireDateColumn); } public void SetHireDateNull() { this[this.tableEmployees.HireDateColumn] = System.Convert.DBNull; } public bool IsAddressNull() { return this.IsNull(this.tableEmployees.AddressColumn); } public void SetAddressNull() { this[this.tableEmployees.AddressColumn] = System.Convert.DBNull; } public bool IsCityNull() { return this.IsNull(this.tableEmployees.CityColumn); } public void SetCityNull() { this[this.tableEmployees.CityColumn] = System.Convert.DBNull; } public bool IsRegionNull() { return this.IsNull(this.tableEmployees.RegionColumn); } public void SetRegionNull() { this[this.tableEmployees.RegionColumn] = System.Convert.DBNull; } public bool IsPostalCodeNull() { return this.IsNull(this.tableEmployees.PostalCodeColumn); } public void SetPostalCodeNull() { this[this.tableEmployees.PostalCodeColumn] = System.Convert.DBNull; } public bool IsCountryNull() { return this.IsNull(this.tableEmployees.CountryColumn); } public void SetCountryNull() { this[this.tableEmployees.CountryColumn] = System.Convert.DBNull; } public bool IsHomePhoneNull() { return this.IsNull(this.tableEmployees.HomePhoneColumn); } public void SetHomePhoneNull() { this[this.tableEmployees.HomePhoneColumn] = System.Convert.DBNull; } public bool IsExtensionNull() { return this.IsNull(this.tableEmployees.ExtensionColumn); } public void SetExtensionNull() { this[this.tableEmployees.ExtensionColumn] = System.Convert.DBNull; } public bool IsPhotoNull() { return this.IsNull(this.tableEmployees.PhotoColumn); } public void SetPhotoNull() { this[this.tableEmployees.PhotoColumn] = System.Convert.DBNull; } public bool IsNotesNull() { return this.IsNull(this.tableEmployees.NotesColumn); } public void SetNotesNull() { this[this.tableEmployees.NotesColumn] = System.Convert.DBNull; } public bool IsReportsToNull() { return this.IsNull(this.tableEmployees.ReportsToColumn); } public void SetReportsToNull() { this[this.tableEmployees.ReportsToColumn] = System.Convert.DBNull; } public bool IsPhotoPathNull() { return this.IsNull(this.tableEmployees.PhotoPathColumn); } public void SetPhotoPathNull() { this[this.tableEmployees.PhotoPathColumn] = System.Convert.DBNull; } public EmployeesRow[] GetEmployeesRows() { return ((EmployeesRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Employees_Employees"]))); } } public class EmployeesRowChangeEvent : System.EventArgs { private EmployeesRow eventRow; private System.Data.DataRowAction eventAction; public EmployeesRowChangeEvent(EmployeesRow row, System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } public EmployeesRow Row { get { return this.eventRow; } } public System.Data.DataRowAction Action { get { return this.eventAction; } } } } } namespace StandardListControlsSample.NorthwindDataSetTableAdapters { [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 EmployeesTableAdapter : 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 EmployeesTableAdapter() { 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 = "Employees"; tableMapping.ColumnMappings.Add("EmployeeID", "EmployeeID"); tableMapping.ColumnMappings.Add("LastName", "LastName"); tableMapping.ColumnMappings.Add("FirstName", "FirstName"); tableMapping.ColumnMappings.Add("Title", "Title"); tableMapping.ColumnMappings.Add("TitleOfCourtesy", "TitleOfCourtesy"); tableMapping.ColumnMappings.Add("BirthDate", "BirthDate"); tableMapping.ColumnMappings.Add("HireDate", "HireDate"); tableMapping.ColumnMappings.Add("Address", "Address"); tableMapping.ColumnMappings.Add("City", "City"); tableMapping.ColumnMappings.Add("Region", "Region"); tableMapping.ColumnMappings.Add("PostalCode", "PostalCode"); tableMapping.ColumnMappings.Add("Country", "Country"); tableMapping.ColumnMappings.Add("HomePhone", "HomePhone"); tableMapping.ColumnMappings.Add("Extension", "Extension"); tableMapping.ColumnMappings.Add("Photo", "Photo"); tableMapping.ColumnMappings.Add("Notes", "Notes"); tableMapping.ColumnMappings.Add("ReportsTo", "ReportsTo"); tableMapping.ColumnMappings.Add("PhotoPath", "PhotoPath"); 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 [dbo].[Employees] WHERE (([EmployeeID] = @Original_EmployeeID) AND ([LastName] = @Original_LastName) AND ([FirstName] = @Original_FirstName) AND ((@IsNull_Title = 1 AND [Title] IS NULL) OR ([Title] = @Original_Title)) AND ((@IsNull_TitleOfCourtesy = 1 AND [TitleOfCourtesy] IS NULL) OR ([TitleOfCourtesy] = @Original_TitleOfCourtesy)) AND ((@IsNull_BirthDate = 1 AND [BirthDate] IS NULL) OR ([BirthDate] = @Original_BirthDate)) AND ((@IsNull_HireDate = 1 AND [HireDate] IS NULL) OR ([HireDate] = @Original_HireDate)) AND ((@IsNull_Address = 1 AND [Address] IS NULL) OR ([Address] = @Original_Address)) AND ((@IsNull_City = 1 AND [City] IS NULL) OR ([City] = @Original_City)) AND ((@IsNull_Region = 1 AND [Region] IS NULL) OR ([Region] = @Original_Region)) AND ((@IsNull_PostalCode = 1 AND [PostalCode] IS NULL) OR ([PostalCode] = @Original_PostalCode)) AND ((@IsNull_Country = 1 AND [Country] IS NULL) OR ([Country] = @Original_Country)) AND ((@IsNull_HomePhone = 1 AND [HomePhone] IS NULL) OR ([HomePhone] = @Original_HomePhone)) AND ((@IsNull_Extension = 1 AND [Extension] IS NULL) OR ([Extension] = @Original_Extension)) AND ((@IsNull_ReportsTo = 1 AND [ReportsTo] IS NULL) OR ([ReportsTo] = @Original_ReportsTo)) AND ((@IsNull_PhotoPath = 1 AND [PhotoPath] IS NULL) OR ([PhotoPath] = @Original_PhotoPath)))"; this.m_adapter.DeleteCommand.CommandType = System.Data.CommandType.Text; this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_EmployeeID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmployeeID", 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("@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_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("@IsNull_TitleOfCourtesy", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "TitleOfCourtesy", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_TitleOfCourtesy", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "TitleOfCourtesy", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_BirthDate", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "BirthDate", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BirthDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "BirthDate", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_HireDate", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "HireDate", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HireDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "HireDate", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Address", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_City", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "City", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_City", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "City", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Region", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Region", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Region", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Region", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_PostalCode", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "PostalCode", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PostalCode", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PostalCode", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Country", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Country", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Country", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Country", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_HomePhone", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "HomePhone", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HomePhone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "HomePhone", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Extension", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Extension", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Extension", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Extension", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_ReportsTo", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ReportsTo", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ReportsTo", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ReportsTo", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_PhotoPath", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "PhotoPath", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PhotoPath", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PhotoPath", 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 [dbo].[Employees] ([LastName], [FirstName], [Title], [TitleOfCourtesy], [BirthDate], [HireDate], [Address], [City], [Region], [PostalCode], [Country], [HomePhone], [Extension], [Photo], [Notes], [ReportsTo], [PhotoPath]) VALUES (@LastName, @FirstName, @Title, @TitleOfCourtesy, @BirthDate, @HireDate, @Address, @City, @Region, @PostalCode, @Country, @HomePhone, @Extension, @Photo, @Notes, @ReportsTo, @PhotoPath); SELECT EmployeeID, LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, PostalCode, Country, HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath FROM Employees WHERE (EmployeeID = @@IDENTITY)"; this.m_adapter.InsertCommand.CommandType = System.Data.CommandType.Text; 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("@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("@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("@TitleOfCourtesy", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "TitleOfCourtesy", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "BirthDate", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HireDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "HireDate", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@City", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "City", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Region", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Region", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PostalCode", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PostalCode", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Country", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Country", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HomePhone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "HomePhone", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Extension", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Extension", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Photo", System.Data.SqlDbType.VarBinary, 0, System.Data.ParameterDirection.Input, 0, 0, "Photo", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Notes", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Notes", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReportsTo", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ReportsTo", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PhotoPath", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PhotoPath", 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 [dbo].[Employees] SET [LastName] = @LastName, [FirstName] = @FirstName, [T" + "itle] = @Title, [TitleOfCourtesy] = @TitleOfCourtesy, [BirthDate] = @BirthDate, " + "[HireDate] = @HireDate, [Address] = @Address, [City] = @City, [Region] = @Region" + ", [PostalCode] = @PostalCode, [Country] = @Country, [HomePhone] = @HomePhone, [E" + "xtension] = @Extension, [Photo] = @Photo, [Notes] = @Notes, [ReportsTo] = @Repor" + "tsTo, [PhotoPath] = @PhotoPath WHERE (([EmployeeID] = @Original_EmployeeID) AND " + "([LastName] = @Original_LastName) AND ([FirstName] = @Original_FirstName) AND ((" + "@IsNull_Title = 1 AND [Title] IS NULL) OR ([Title] = @Original_Title)) AND ((@Is" + "Null_TitleOfCourtesy = 1 AND [TitleOfCourtesy] IS NULL) OR ([TitleOfCourtesy] = " + "@Original_TitleOfCourtesy)) AND ((@IsNull_BirthDate = 1 AND [BirthDate] IS NULL)" + " OR ([BirthDate] = @Original_BirthDate)) AND ((@IsNull_HireDate = 1 AND [HireDat" + "e] IS NULL) OR ([HireDate] = @Original_HireDate)) AND ((@IsNull_Address = 1 AND " + "[Address] IS NULL) OR ([Address] = @Original_Address)) AND ((@IsNull_City = 1 AN" + "D [City] IS NULL) OR ([City] = @Original_City)) AND ((@IsNull_Region = 1 AND [Re" + "gion] IS NULL) OR ([Region] = @Original_Region)) AND ((@IsNull_PostalCode = 1 AN" + "D [PostalCode] IS NULL) OR ([PostalCode] = @Original_PostalCode)) AND ((@IsNull_" + "Country = 1 AND [Country] IS NULL) OR ([Country] = @Original_Country)) AND ((@Is" + "Null_HomePhone = 1 AND [HomePhone] IS NULL) OR ([HomePhone] = @Original_HomePhon" + "e)) AND ((@IsNull_Extension = 1 AND [Extension] IS NULL) OR ([Extension] = @Orig" + "inal_Extension)) AND ((@IsNull_ReportsTo = 1 AND [ReportsTo] IS NULL) OR ([Repor" + "tsTo] = @Original_ReportsTo)) AND ((@IsNull_PhotoPath = 1 AND [PhotoPath] IS NUL" + "L) OR ([PhotoPath] = @Original_PhotoPath)));\r\nSELECT EmployeeID, LastName, First" + "Name, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, Postal" + "Code, Country, HomePhone, Extension, Photo, Notes, ReportsTo, PhotoPath FROM Emp" + "loyees WHERE (EmployeeID = @EmployeeID)"; this.m_adapter.UpdateCommand.CommandType = System.Data.CommandType.Text; 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("@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("@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("@TitleOfCourtesy", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "TitleOfCourtesy", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "BirthDate", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HireDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "HireDate", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@City", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "City", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Region", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Region", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PostalCode", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PostalCode", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Country", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Country", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HomePhone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "HomePhone", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Extension", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Extension", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Photo", System.Data.SqlDbType.VarBinary, 0, System.Data.ParameterDirection.Input, 0, 0, "Photo", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Notes", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Notes", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ReportsTo", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ReportsTo", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PhotoPath", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PhotoPath", System.Data.DataRowVersion.Current, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_EmployeeID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "EmployeeID", 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("@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_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("@IsNull_TitleOfCourtesy", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "TitleOfCourtesy", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_TitleOfCourtesy", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "TitleOfCourtesy", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_BirthDate", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "BirthDate", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_BirthDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "BirthDate", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_HireDate", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "HireDate", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HireDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, 0, 0, "HireDate", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Address", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Address", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Address", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_City", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "City", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_City", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "City", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Region", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Region", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Region", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Region", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_PostalCode", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "PostalCode", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PostalCode", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PostalCode", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Country", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Country", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Country", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Country", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_HomePhone", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "HomePhone", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_HomePhone", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "HomePhone", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_Extension", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "Extension", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Extension", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "Extension", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_ReportsTo", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ReportsTo", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ReportsTo", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "ReportsTo", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNull_PhotoPath", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, 0, 0, "PhotoPath", System.Data.DataRowVersion.Original, true, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PhotoPath", System.Data.SqlDbType.NVarChar, 0, System.Data.ParameterDirection.Input, 0, 0, "PhotoPath", System.Data.DataRowVersion.Original, false, null, "", "", "")); this.m_adapter.UpdateCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EmployeeID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, 0, 0, "EmployeeID", System.Data.DataRowVersion.Current, false, null, "", "", "")); } private void InitConnection() { this.m_connection = new System.Data.SqlClient.SqlConnection(); this.m_connection.ConnectionString = StandardListControlsSample.Properties.Settings.Default.NorthwindConnectionString; } 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 EmployeeID, LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDa" + "te, Address, City, Region, PostalCode, Country, HomePhone, Extension, Photo, Not" + "es, ReportsTo, PhotoPath FROM dbo.Employees"; this.m_commandCollection[0].CommandType = System.Data.CommandType.Text; } [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)] public virtual int Fill(NorthwindDataSet.EmployeesDataTable 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 NorthwindDataSet.EmployeesDataTable GetData() { this.Adapter.SelectCommand = this.CommandCollection[0]; NorthwindDataSet.EmployeesDataTable dataTable = new NorthwindDataSet.EmployeesDataTable(); this.Adapter.Fill(dataTable); return dataTable; } public virtual int Update(NorthwindDataSet.EmployeesDataTable dataTable) { return this.Adapter.Update(dataTable); } public virtual int Update(NorthwindDataSet dataSet) { return this.Adapter.Update(dataSet, "Employees"); } 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_EmployeeID, string Original_LastName, string Original_FirstName, string Original_Title, string Original_TitleOfCourtesy, System.Nullable Original_BirthDate, System.Nullable Original_HireDate, string Original_Address, string Original_City, string Original_Region, string Original_PostalCode, string Original_Country, string Original_HomePhone, string Original_Extension, System.Nullable Original_ReportsTo, string Original_PhotoPath) { this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_EmployeeID)); if ((Original_LastName == null)) { throw new System.ArgumentNullException("Original_LastName"); } else { this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_LastName)); } if ((Original_FirstName == null)) { throw new System.ArgumentNullException("Original_FirstName"); } else { this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_FirstName)); } if ((Original_Title == null)) { this.Adapter.DeleteCommand.Parameters[3].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[4].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[3].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_Title)); } if ((Original_TitleOfCourtesy == 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_TitleOfCourtesy)); } if ((Original_BirthDate.HasValue == true)) { this.Adapter.DeleteCommand.Parameters[7].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[8].Value = ((System.DateTime)(Original_BirthDate.Value)); } else { this.Adapter.DeleteCommand.Parameters[7].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[8].Value = System.DBNull.Value; } if ((Original_HireDate.HasValue == true)) { this.Adapter.DeleteCommand.Parameters[9].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[10].Value = ((System.DateTime)(Original_HireDate.Value)); } else { this.Adapter.DeleteCommand.Parameters[9].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[10].Value = System.DBNull.Value; } if ((Original_Address == null)) { this.Adapter.DeleteCommand.Parameters[11].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[12].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[11].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[12].Value = ((string)(Original_Address)); } if ((Original_City == 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_City)); } if ((Original_Region == null)) { this.Adapter.DeleteCommand.Parameters[15].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[16].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[15].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[16].Value = ((string)(Original_Region)); } if ((Original_PostalCode == null)) { this.Adapter.DeleteCommand.Parameters[17].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[18].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[17].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[18].Value = ((string)(Original_PostalCode)); } if ((Original_Country == null)) { this.Adapter.DeleteCommand.Parameters[19].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[20].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[19].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[20].Value = ((string)(Original_Country)); } if ((Original_HomePhone == null)) { this.Adapter.DeleteCommand.Parameters[21].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[22].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[21].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[22].Value = ((string)(Original_HomePhone)); } if ((Original_Extension == null)) { this.Adapter.DeleteCommand.Parameters[23].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[24].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[23].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[24].Value = ((string)(Original_Extension)); } if ((Original_ReportsTo.HasValue == true)) { this.Adapter.DeleteCommand.Parameters[25].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[26].Value = ((int)(Original_ReportsTo.Value)); } else { this.Adapter.DeleteCommand.Parameters[25].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[26].Value = System.DBNull.Value; } if ((Original_PhotoPath == null)) { this.Adapter.DeleteCommand.Parameters[27].Value = ((int)(1)); this.Adapter.DeleteCommand.Parameters[28].Value = System.DBNull.Value; } else { this.Adapter.DeleteCommand.Parameters[27].Value = ((int)(0)); this.Adapter.DeleteCommand.Parameters[28].Value = ((string)(Original_PhotoPath)); } 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( string LastName, string FirstName, string Title, string TitleOfCourtesy, System.Nullable BirthDate, System.Nullable HireDate, string Address, string City, string Region, string PostalCode, string Country, string HomePhone, string Extension, byte[] Photo, string Notes, System.Nullable ReportsTo, string PhotoPath) { if ((LastName == null)) { throw new System.ArgumentNullException("LastName"); } else { this.Adapter.InsertCommand.Parameters[0].Value = ((string)(LastName)); } if ((FirstName == null)) { throw new System.ArgumentNullException("FirstName"); } else { this.Adapter.InsertCommand.Parameters[1].Value = ((string)(FirstName)); } if ((Title == null)) { this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[2].Value = ((string)(Title)); } if ((TitleOfCourtesy == null)) { this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[3].Value = ((string)(TitleOfCourtesy)); } if ((BirthDate.HasValue == true)) { this.Adapter.InsertCommand.Parameters[4].Value = ((System.DateTime)(BirthDate.Value)); } else { this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value; } if ((HireDate.HasValue == true)) { this.Adapter.InsertCommand.Parameters[5].Value = ((System.DateTime)(HireDate.Value)); } else { this.Adapter.InsertCommand.Parameters[5].Value = System.DBNull.Value; } if ((Address == null)) { this.Adapter.InsertCommand.Parameters[6].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[6].Value = ((string)(Address)); } if ((City == null)) { this.Adapter.InsertCommand.Parameters[7].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[7].Value = ((string)(City)); } if ((Region == null)) { this.Adapter.InsertCommand.Parameters[8].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[8].Value = ((string)(Region)); } if ((PostalCode == null)) { this.Adapter.InsertCommand.Parameters[9].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[9].Value = ((string)(PostalCode)); } if ((Country == null)) { this.Adapter.InsertCommand.Parameters[10].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[10].Value = ((string)(Country)); } if ((HomePhone == null)) { this.Adapter.InsertCommand.Parameters[11].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[11].Value = ((string)(HomePhone)); } if ((Extension == null)) { this.Adapter.InsertCommand.Parameters[12].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[12].Value = ((string)(Extension)); } if ((Photo == null)) { this.Adapter.InsertCommand.Parameters[13].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[13].Value = ((byte[])(Photo)); } if ((Notes == null)) { this.Adapter.InsertCommand.Parameters[14].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[14].Value = ((string)(Notes)); } if ((ReportsTo.HasValue == true)) { this.Adapter.InsertCommand.Parameters[15].Value = ((int)(ReportsTo.Value)); } else { this.Adapter.InsertCommand.Parameters[15].Value = System.DBNull.Value; } if ((PhotoPath == null)) { this.Adapter.InsertCommand.Parameters[16].Value = System.DBNull.Value; } else { this.Adapter.InsertCommand.Parameters[16].Value = ((string)(PhotoPath)); } 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( string LastName, string FirstName, string Title, string TitleOfCourtesy, System.Nullable BirthDate, System.Nullable HireDate, string Address, string City, string Region, string PostalCode, string Country, string HomePhone, string Extension, byte[] Photo, string Notes, System.Nullable ReportsTo, string PhotoPath, int Original_EmployeeID, string Original_LastName, string Original_FirstName, string Original_Title, string Original_TitleOfCourtesy, System.Nullable Original_BirthDate, System.Nullable Original_HireDate, string Original_Address, string Original_City, string Original_Region, string Original_PostalCode, string Original_Country, string Original_HomePhone, string Original_Extension, System.Nullable Original_ReportsTo, string Original_PhotoPath, int EmployeeID) { if ((LastName == null)) { throw new System.ArgumentNullException("LastName"); } else { this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(LastName)); } if ((FirstName == null)) { throw new System.ArgumentNullException("FirstName"); } else { this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(FirstName)); } if ((Title == null)) { this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(Title)); } if ((TitleOfCourtesy == null)) { this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(TitleOfCourtesy)); } if ((BirthDate.HasValue == true)) { this.Adapter.UpdateCommand.Parameters[4].Value = ((System.DateTime)(BirthDate.Value)); } else { this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value; } if ((HireDate.HasValue == true)) { this.Adapter.UpdateCommand.Parameters[5].Value = ((System.DateTime)(HireDate.Value)); } else { this.Adapter.UpdateCommand.Parameters[5].Value = System.DBNull.Value; } if ((Address == null)) { this.Adapter.UpdateCommand.Parameters[6].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Address)); } if ((City == null)) { this.Adapter.UpdateCommand.Parameters[7].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(City)); } if ((Region == null)) { this.Adapter.UpdateCommand.Parameters[8].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Region)); } if ((PostalCode == null)) { this.Adapter.UpdateCommand.Parameters[9].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(PostalCode)); } if ((Country == null)) { this.Adapter.UpdateCommand.Parameters[10].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Country)); } if ((HomePhone == null)) { this.Adapter.UpdateCommand.Parameters[11].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[11].Value = ((string)(HomePhone)); } if ((Extension == null)) { this.Adapter.UpdateCommand.Parameters[12].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[12].Value = ((string)(Extension)); } if ((Photo == null)) { this.Adapter.UpdateCommand.Parameters[13].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[13].Value = ((byte[])(Photo)); } if ((Notes == null)) { this.Adapter.UpdateCommand.Parameters[14].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[14].Value = ((string)(Notes)); } if ((ReportsTo.HasValue == true)) { this.Adapter.UpdateCommand.Parameters[15].Value = ((int)(ReportsTo.Value)); } else { this.Adapter.UpdateCommand.Parameters[15].Value = System.DBNull.Value; } if ((PhotoPath == null)) { this.Adapter.UpdateCommand.Parameters[16].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[16].Value = ((string)(PhotoPath)); } this.Adapter.UpdateCommand.Parameters[17].Value = ((int)(Original_EmployeeID)); if ((Original_LastName == null)) { throw new System.ArgumentNullException("Original_LastName"); } else { this.Adapter.UpdateCommand.Parameters[18].Value = ((string)(Original_LastName)); } if ((Original_FirstName == null)) { throw new System.ArgumentNullException("Original_FirstName"); } else { this.Adapter.UpdateCommand.Parameters[19].Value = ((string)(Original_FirstName)); } if ((Original_Title == null)) { this.Adapter.UpdateCommand.Parameters[20].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[21].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[20].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[21].Value = ((string)(Original_Title)); } if ((Original_TitleOfCourtesy == 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_TitleOfCourtesy)); } if ((Original_BirthDate.HasValue == true)) { this.Adapter.UpdateCommand.Parameters[24].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[25].Value = ((System.DateTime)(Original_BirthDate.Value)); } else { this.Adapter.UpdateCommand.Parameters[24].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[25].Value = System.DBNull.Value; } if ((Original_HireDate.HasValue == true)) { this.Adapter.UpdateCommand.Parameters[26].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[27].Value = ((System.DateTime)(Original_HireDate.Value)); } else { this.Adapter.UpdateCommand.Parameters[26].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[27].Value = System.DBNull.Value; } if ((Original_Address == null)) { this.Adapter.UpdateCommand.Parameters[28].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[29].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[28].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[29].Value = ((string)(Original_Address)); } if ((Original_City == null)) { this.Adapter.UpdateCommand.Parameters[30].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[31].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[30].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[31].Value = ((string)(Original_City)); } if ((Original_Region == null)) { this.Adapter.UpdateCommand.Parameters[32].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[33].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[32].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[33].Value = ((string)(Original_Region)); } if ((Original_PostalCode == null)) { this.Adapter.UpdateCommand.Parameters[34].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[35].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[34].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[35].Value = ((string)(Original_PostalCode)); } if ((Original_Country == null)) { this.Adapter.UpdateCommand.Parameters[36].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[37].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[36].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[37].Value = ((string)(Original_Country)); } if ((Original_HomePhone == null)) { this.Adapter.UpdateCommand.Parameters[38].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[39].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[38].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[39].Value = ((string)(Original_HomePhone)); } if ((Original_Extension == null)) { this.Adapter.UpdateCommand.Parameters[40].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[41].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[40].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[41].Value = ((string)(Original_Extension)); } if ((Original_ReportsTo.HasValue == true)) { this.Adapter.UpdateCommand.Parameters[42].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[43].Value = ((int)(Original_ReportsTo.Value)); } else { this.Adapter.UpdateCommand.Parameters[42].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[43].Value = System.DBNull.Value; } if ((Original_PhotoPath == null)) { this.Adapter.UpdateCommand.Parameters[44].Value = ((int)(1)); this.Adapter.UpdateCommand.Parameters[45].Value = System.DBNull.Value; } else { this.Adapter.UpdateCommand.Parameters[44].Value = ((int)(0)); this.Adapter.UpdateCommand.Parameters[45].Value = ((string)(Original_PhotoPath)); } this.Adapter.UpdateCommand.Parameters[46].Value = ((int)(EmployeeID)); 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(); } } } } }