private void InitClass() { this.DataSetName = "_CustomerTDS"; this.Prefix = ""; this.Namespace = "http://tempuri.org/ADONET.xsd"; this.Locale = new System.Globalization.CultureInfo("en-US"); this.CaseSensitive = false; this.EnforceConstraints = true; this.tableCustomer = CreateCustomerDataTable(null); this.Tables.Add(this.tableCustomer); this.tableInvoice = CreateInvoiceDataTable(null); this.Tables.Add(this.tableInvoice); ForeignKeyConstraint fkc; fkc = new ForeignKeyConstraint("CustomerInvoice", new DataColumn[] { this.tableCustomer.CustomerIDColumn }, new DataColumn[] { this.tableInvoice.CustomerIDColumn }); this.tableInvoice.Constraints.Add(fkc); fkc.AcceptRejectRule = AcceptRejectRule.Cascade; fkc.DeleteRule = Rule.Cascade; fkc.UpdateRule = Rule.Cascade; this.relationCustomerInvoice = new DataRelation("CustomerInvoice", new DataColumn[] { this.tableCustomer.CustomerIDColumn }, new DataColumn[] { this.tableInvoice.CustomerIDColumn }, false); this.Relations.Add(this.relationCustomerInvoice); }
public override DataTable Clone() { InvoiceDataTable cln = ((InvoiceDataTable)(base.Clone())); cln.InitVars(); return(cln); }
private void UpdateInvoiceDataTable() { try { string connectionString = ConfigurationManager.ConnectionStrings["db-connection"].ConnectionString; using (MySqlConnection connection = new MySqlConnection(connectionString)) { connection.Open(); using (MySqlCommand command = new MySqlCommand("SELECT * FROM invoice")) { using (MySqlDataAdapter invoiceDataAdapter = new MySqlDataAdapter()) { command.Connection = connection; invoiceDataAdapter.SelectCommand = command; using (DataTable table = new DataTable()) { invoiceDataAdapter.Fill(table); InvoiceDataTable.DataSource = table; InvoiceDataTable.DataBind(); InvoiceDataTable.HeaderRow.Cells[0].Text = "Invoice ID"; InvoiceDataTable.HeaderRow.Cells[1].Text = "Ordered"; InvoiceDataTable.HeaderRow.Cells[2].Text = "Shipped"; InvoiceDataTable.HeaderRow.Cells[3].Text = "Total Amount"; InvoiceDataTable.HeaderRow.Cells[4].Text = "Customer ID"; InvoiceDataTable.HeaderRow.Cells[5].Text = "Status"; } } } connection.Close(); } } catch (MySqlException err) { Response.Write("<script>alert('Connection was interrupted.');</script>"); } }
internal void InitVars() { this.tableInvoice = ((InvoiceDataTable)(this.Tables["Invoice"])); if ((this.tableInvoice != null)) { this.tableInvoice.InitVars(); } }
private void InitClass() { this.DataSetName = "debtListSet"; this.Prefix = ""; this.Namespace = "http://www.tempuri.org/debtListSet.xsd"; this.EnforceConstraints = true; this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; this.tableInvoice = new InvoiceDataTable(); base.Tables.Add(this.tableInvoice); }
private void InitClass() { this.DataSetName = "viewInvoice"; this.Prefix = ""; this.Namespace = "http://www.tempuri.org/viewInvoice.xsd"; this.Locale = new System.Globalization.CultureInfo("en-US"); this.CaseSensitive = false; this.EnforceConstraints = true; this.tableInvoice = new InvoiceDataTable(); this.Tables.Add(this.tableInvoice); }
internal void InitVars(bool initTable) { this.tableInvoice = ((InvoiceDataTable)(base.Tables["Invoice"])); if ((initTable == true)) { if ((this.tableInvoice != null)) { this.tableInvoice.InitVars(); } } }
internal void InitVars() { this.tableCustomer = ((CustomerDataTable)(this.Tables["Customer"])); if ((this.tableCustomer != null)) { this.tableCustomer.InitVars(); } this.tableInvoice = ((InvoiceDataTable)(this.Tables["Invoice"])); if ((this.tableInvoice != null)) { this.tableInvoice.InitVars(); } this.relationCustomerInvoice = this.Relations["CustomerInvoice"]; }
internal InvoiceRow(DataRowBuilder rb) : base(rb) { this.tableInvoice = ((InvoiceDataTable)(this.Table)); }
internal InvoiceRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableInvoice = ((InvoiceDataTable)(this.Table)); }