📄 datatables.cs
字号:
// btnForeign
//
this.btnForeign.Location = new System.Drawing.Point(416, 216);
this.btnForeign.Name = "btnForeign";
this.btnForeign.Size = new System.Drawing.Size(96, 24);
this.btnForeign.TabIndex = 9;
this.btnForeign.Text = "Foreign Key";
//
// btnSchema
//
this.btnSchema.Location = new System.Drawing.Point(416, 184);
this.btnSchema.Name = "btnSchema";
this.btnSchema.Size = new System.Drawing.Size(96, 24);
this.btnSchema.TabIndex = 10;
this.btnSchema.Text = "FillSchema";
//
// btnVersion
//
this.btnVersion.Location = new System.Drawing.Point(416, 152);
this.btnVersion.Name = "btnVersion";
this.btnVersion.Size = new System.Drawing.Size(96, 24);
this.btnVersion.TabIndex = 11;
this.btnVersion.Text = "Row Version";
//
// btnAddRow
//
this.btnAddRow.Location = new System.Drawing.Point(416, 120);
this.btnAddRow.Name = "btnAddRow";
this.btnAddRow.Size = new System.Drawing.Size(96, 24);
this.btnAddRow.TabIndex = 12;
this.btnAddRow.Text = "Add DataRow";
//
// btnCalculate
//
this.btnCalculate.Location = new System.Drawing.Point(416, 88);
this.btnCalculate.Name = "btnCalculate";
this.btnCalculate.Size = new System.Drawing.Size(96, 24);
this.btnCalculate.TabIndex = 13;
this.btnCalculate.Text = "Calculate";
//
// cnNorthwind
//
this.cnNorthwind.ConnectionString = "data source=localhost;initial catalog=nwind;integrated security=SSPI;persist " +
"security info=False;packet size=4096";
//
// daCustomers
//
this.daCustomers.SelectCommand = this.cmdSelectCustomers;
this.daCustomers.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "CustomerList", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("CustomerID", "CustomerID"),
new System.Data.Common.DataColumnMapping("CompanyName", "CompanyName"),
new System.Data.Common.DataColumnMapping("City", "City"),
new System.Data.Common.DataColumnMapping("Country", "Country"),
new System.Data.Common.DataColumnMapping("PostalCode", "PostalCode"),
new System.Data.Common.DataColumnMapping("Region", "Region")})});
//
// cmdSelectCustomers
//
this.cmdSelectCustomers.CommandText = "SELECT CustomerID, CompanyName, City, Country, PostalCode, Region FROM CustomerLi" +
"st";
this.cmdSelectCustomers.Connection = this.cnNorthwind;
//
// dsUntyped
//
this.dsUntyped.DataSetName = "dsUntyped";
this.dsUntyped.Locale = new System.Globalization.CultureInfo("en-US");
this.dsUntyped.Tables.AddRange(new System.Data.DataTable[] {
this.dtMaster,
this.dtChild});
//
// dtMaster
//
this.dtMaster.Columns.AddRange(new System.Data.DataColumn[] {
this.MasterID,
this.MasterValue});
this.dtMaster.TableName = "dtMaster";
//
// MasterID
//
this.MasterID.AllowDBNull = false;
this.MasterID.AutoIncrement = true;
this.MasterID.Caption = "MasterID";
this.MasterID.ColumnName = "MasterID";
this.MasterID.DataType = typeof(int);
//
// MasterValue
//
this.MasterValue.Caption = "MasterValue";
this.MasterValue.ColumnName = "MasterValue";
//
// dtChild
//
this.dtChild.Columns.AddRange(new System.Data.DataColumn[] {
this.ChildID,
this.MasterLink,
this.ChildValue});
this.dtChild.TableName = "dtChild";
//
// ChildID
//
this.ChildID.AllowDBNull = false;
this.ChildID.AutoIncrement = true;
this.ChildID.Caption = "ChildID";
this.ChildID.ColumnName = "ChildID";
this.ChildID.DataType = typeof(int);
//
// MasterLink
//
this.MasterLink.AllowDBNull = false;
this.MasterLink.Caption = "MasterLink";
this.MasterLink.ColumnName = "MasterLink";
this.MasterLink.DataType = typeof(int);
//
// ChildValue
//
this.ChildValue.Caption = "ChildValue";
this.ChildValue.ColumnName = "ChildValue";
//
// daEmployees
//
this.daEmployees.SelectCommand = this.cmdSelectEmployees;
this.daEmployees.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "EmployeeList", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("EmployeeID", "EmployeeID"),
new System.Data.Common.DataColumnMapping("FirstName", "FirstName"),
new System.Data.Common.DataColumnMapping("LastName", "LastName")})});
//
// cmdSelectEmployees
//
this.cmdSelectEmployees.CommandText = "SELECT EmployeeID, FirstName, LastName FROM EmployeeList";
this.cmdSelectEmployees.Connection = this.cnNorthwind;
//
// daOrders
//
this.daOrders.SelectCommand = this.cmdSelectOrders;
this.daOrders.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "OrderTotals", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("CustomerID", "CustomerID"),
new System.Data.Common.DataColumnMapping("OrderID", "OrderID"),
new System.Data.Common.DataColumnMapping("OrderDate", "OrderDate"),
new System.Data.Common.DataColumnMapping("Subtotal", "Subtotal")})});
//
// cmdSelectOrders
//
this.cmdSelectOrders.CommandText = "SELECT EmployeeID, CustomerID, OrderID, OrderDate, Subtotal FROM OrderTotals";
this.cmdSelectOrders.Connection = this.cnNorthwind;
//
// dsMaster1
//
this.dsMaster1.DataSetName = "dsMaster";
this.dsMaster1.Locale = new System.Globalization.CultureInfo("en-US");
this.dsMaster1.Namespace = "http://www.tempuri.org/dsMaster.xsd";
//
// btnTable
//
this.btnTable.Location = new System.Drawing.Point(416, 24);
this.btnTable.Name = "btnTable";
this.btnTable.Size = new System.Drawing.Size(96, 24);
this.btnTable.TabIndex = 14;
this.btnTable.Text = "Add Table";
//
// frmDataSets
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(520, 373);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.btnTable,
this.btnCalculate,
this.btnAddRow,
this.btnVersion,
this.btnSchema,
this.btnForeign,
this.btnUnique,
this.btnSelect,
this.btnDataSet,
this.dgOrders,
this.lbClients,
this.lbEmployees,
this.label3,
this.label2,
this.label1});
this.Name = "frmDataSets";
this.Text = "DataTables";
((System.ComponentModel.ISupportInitialize)(this.dgOrders)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dsUntyped)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dtMaster)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dtChild)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dsMaster1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new frmDataSets());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -