我今天刚弄了delphi2005用了下,下面是我在做简单的C#project时,Delphi2005自动生成的代码,我想这段代码,不用我说,你们也知道发生了什么
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace DelDotNet
{
/// <summary>
/// Summary description for WinForm.
/// </summary>
public class WinForm : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Windows.Forms.DataGrid dataGrid1;
private DelDotNet.DataSet1 dataSet11;
private System.Windows.Forms.MenuItem menuItem3;
private Borland.Data.Provider.BdpConnection bdpConnection1;
private Borland.Data.Provider.BdpCommand bdpSelectCommand1;
private Borland.Data.Provider.BdpCommand bdpInsertCommand1;
private Borland.Data.Provider.BdpCommand bdpUpdateCommand1;
private Borland.Data.Provider.BdpCommand bdpDeleteCommand1;
private Borland.Data.Provider.BdpDataAdapter bdpDataAdapter1;
private DelDotNet.DataSet2 dataSetau;
public WinForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support -do
not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataSet11 = new DelDotNet.DataSet1();
this.bdpConnection1 = new Borland.Data.Provider.BdpConnection();
this.bdpSelectCommand1 = new Borland.Data.Provider.BdpCommand();
this.bdpInsertCommand1 = new Borland.Data.Provider.BdpCommand();
this.bdpUpdateCommand1 = new Borland.Data.Provider.BdpCommand();
this.bdpDeleteCommand1 = new Borland.Data.Provider.BdpCommand();
this.bdpDataAdapter1 = new Borland.Data.Provider.BdpDataAdapter();
this.dataSetau = new DelDotNet.DataSet2();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).begin
Init();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).begin
Init();
((System.ComponentModel.ISupportInitialize)(this.bdpDataAdapter1)).begin
Init();
((System.ComponentModel.ISupportInitialize)(this.dataSetau)).begin
Init();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem3});
this.menuItem1.Text = "hello";
//
// menuItem2
//
this.menuItem2.Checked = true;
this.menuItem2.Index = 0;
this.menuItem2.RadioCheck = true;
this.menuItem2.Text = "yes";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "all";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "integrated security=SSPI;data source=/"./";persist security info=Fal"
+
"se;initial catalog=pubs";
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "select * from Titles";
this.sqlSelectCommand1.Connection = this.sqlConnection1;
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
//
// dataGrid1
//
this.dataGrid1.AlternatingBackColor = System.Drawing.Color.Lavender;
this.dataGrid1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.BackgroundColor = System.Drawing.Color.LightGray;
this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.LightSteelBlue;
this.dataGrid1.CaptionForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.DataMember = "";
this.dataGrid1.DataSource = this.dataSetau.authors;
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid1.ForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.GridLineColor = System.Drawing.Color.Gainsboro;
this.dataGrid1.GridLineStyle = System.Windows.Forms.DataGridLineStyle.None;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.HeaderForeColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.LinkColor = System.Drawing.Color.Teal;
this.dataGrid1.Location = new System.Drawing.Point(0, 0);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.Gainsboro;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.CadetBlue;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.Size = new System.Drawing.Size(792, 370);
this.dataGrid1.TabIndex = 0;
//
// dataSet11
//
this.dataSet11.DataSetName = "DataSet1";
this.dataSet11.Locale = new System.Globalization.CultureInfo("zh-CN"
;
this.dataSet11.Namespace = "http://www.changeme.now/DataSet1.xsd";
//
// bdpConnection1
//
this.bdpConnection1.ConnectionOptions = "transaction isolation=ReadCommitted;blobsize=1024";
this.bdpConnection1.ConnectionString = "database=pubs;hostname=.;assembly=Borland.Data.Mssql, Version=2.0."
+
"0.0, Culture=neutral, PublicKeyToken=91d62ebb5b0d1b1b;vendorclien"
+
"t=sqloledb.dll;provider=MSSQL;username=sa;password=erpserver2003";
//
// bdpSelectCommand1
//
this.bdpSelectCommand1.CommandOptions = null;
this.bdpSelectCommand1.CommandText = "SELECT au_id, au_lname, au_fname, phone, address, city, state, zip"
+
", contract FROM dbo.authors";
this.bdpSelectCommand1.CommandType = System.Data.CommandType.Text;
this.bdpSelectCommand1.Connection = this.bdpConnection1;
this.bdpSelectCommand1.ParameterCount = ((short)(0));
this.bdpSelectCommand1.SchemaName = null;
this.bdpSelectCommand1.Transaction = null;
this.bdpSelectCommand1.UpdatedRowSource = System.Data.UpdateRowSource.None;
//
// bdpInsertCommand1
//
this.bdpInsertCommand1.CommandOptions = null;
this.bdpInsertCommand1.CommandText = "INSERT INTO dbo.authors (au_id, au_lname, au_fname, phone, address"
+
", city, state, zip, contract ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?"
+
"
";
this.bdpInsertCommand1.CommandType = System.Data.CommandType.Text;
this.bdpInsertCommand1.Connection = this.bdpConnection1;
this.bdpInsertCommand1.ParameterCount = ((short)(9));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_id", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(11)), ((byte)(0)), 11, "au_id", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_lname", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "au_lname", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_fname", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "au_fname", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("phone", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(12)), ((byte)(0)), 12, "phone", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("address", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "address", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("city", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "city", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("state", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(2)), ((byte)(0)), 2, "state", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("zip", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(5)), ((byte)(0)), 5, "zip", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("contract", Borland.Data.Common.BdpType.Boolean, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), 0, "contract", System.Data.DataRowVersion.Current, null));
this.bdpInsertCommand1.SchemaName = null;
this.bdpInsertCommand1.Transaction = null;
this.bdpInsertCommand1.UpdatedRowSource = System.Data.UpdateRowSource.None;
//
// bdpUpdateCommand1
//
this.bdpUpdateCommand1.CommandOptions = null;
this.bdpUpdateCommand1.CommandText = @"UPDATE dbo.authors SET au_id = ?, au_lname = ?, au_fname = ?, phone = ?, address = ?, city = ?, state = ?, zip = ?, contract = ? WHERE au_id = ? AND au_lname = ? AND au_fname = ? AND phone = ? AND address = ? AND city = ? AND state = ? AND zip = ? AND contract = ?";
this.bdpUpdateCommand1.CommandType = System.Data.CommandType.Text;
this.bdpUpdateCommand1.Connection = this.bdpConnection1;
this.bdpUpdateCommand1.ParameterCount = ((short)(18));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_id", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(11)), ((byte)(0)), 11, "au_id", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_lname", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "au_lname", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_fname", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "au_fname", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("phone", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(12)), ((byte)(0)), 12, "phone", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("address", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "address", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("city", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "city", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("state", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(2)), ((byte)(0)), 2, "state", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("zip", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(5)), ((byte)(0)), 5, "zip", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("contract", Borland.Data.Common.BdpType.Boolean, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), 0, "contract", System.Data.DataRowVersion.Current, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_idOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(11)), ((byte)(0)), 11, "au_id", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_lnameOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "au_lname", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_fnameOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "au_fname", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("phoneOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(12)), ((byte)(0)), 12, "phone", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("addressOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "address", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("cityOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "city", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("stateOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(2)), ((byte)(0)), 2, "state", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("zipOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(5)), ((byte)(0)), 5, "zip", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("contractOriginal", Borland.Data.Common.BdpType.Boolean, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), 0, "contract", System.Data.DataRowVersion.Original, null));
this.bdpUpdateCommand1.SchemaName = null;
this.bdpUpdateCommand1.Transaction = null;
this.bdpUpdateCommand1.UpdatedRowSource = System.Data.UpdateRowSource.None;
//
// bdpDeleteCommand1
//
this.bdpDeleteCommand1.CommandOptions = null;
this.bdpDeleteCommand1.CommandText = "DELETE FROM dbo.authors WHERE au_id = ? AND au_lname = ? AND au_fn"
+
"ame = ? AND phone = ? AND address = ? AND city = ? AND state = ? "
+
"AND zip = ? AND contract = ?";
this.bdpDeleteCommand1.CommandType = System.Data.CommandType.Text;
this.bdpDeleteCommand1.Connection = this.bdpConnection1;
this.bdpDeleteCommand1.ParameterCount = ((short)(9));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_idOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(11)), ((byte)(0)), 11, "au_id", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_lnameOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "au_lname", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("au_fnameOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "au_fname", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("phoneOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(12)), ((byte)(0)), 12, "phone", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("addressOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(40)), ((byte)(0)), 40, "address", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("cityOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(20)), ((byte)(0)), 20, "city", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("stateOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(2)), ((byte)(0)), 2, "state", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("zipOriginal", Borland.Data.Common.BdpType.String, Borland.Data.Common.BdpType.stFixed, 0, System.Data.ParameterDirection.Input, false, ((byte)(5)), ((byte)(0)), 5, "zip", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.Parameters.Add(new Borland.Data.Common.BdpParameter("contractOriginal", Borland.Data.Common.BdpType.Boolean, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), 0, "contract", System.Data.DataRowVersion.Original, null));
this.bdpDeleteCommand1.SchemaName = null;
this.bdpDeleteCommand1.Transaction = null;
this.bdpDeleteCommand1.UpdatedRowSource = System.Data.UpdateRowSource.None;
//
// bdpDataAdapter1
//
this.bdpDataAdapter1.Active = true;
this.bdpDataAdapter1.DataSet = this.dataSetau;
this.bdpDataAdapter1.DataTable = this.dataSetau.authors;
this.bdpDataAdapter1.DeleteCommand = this.bdpDeleteCommand1;
this.bdpDataAdapter1.InsertCommand = this.bdpInsertCommand1;
this.bdpDataAdapter1.SelectCommand = this.bdpSelectCommand1;
this.bdpDataAdapter1.StartRecord = 0;
this.bdpDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "authors", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("au_id", "au_id"
,
new System.Data.Common.DataColumnMapping("au_lname", "au_lname"
,
new System.Data.Common.DataColumnMapping("au_fname", "au_fname"
,
new System.Data.Common.DataColumnMapping("phone", "phone"
,
new System.Data.Common.DataColumnMapping("address", "address"
,
new System.Data.Common.DataColumnMapping("city", "city"
,
new System.Data.Common.DataColumnMapping("state", "state"
,
new System.Data.Common.DataColumnMapping("zip", "zip"
,
new System.Data.Common.DataColumnMapping("contract", "contract"
})});
this.bdpDataAdapter1.UpdateCommand = this.bdpUpdateCommand1;
//
// dataSetau
//
this.dataSetau.DataSetName = "DataSet";
this.dataSetau.Locale = new System.Globalization.CultureInfo("zh-CN"
;
this.dataSetau.Namespace = "http://www.changeme.now/DataSet2.xsd";
//
// WinForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(792, 370);
this.Controls.Add(this.dataGrid1);
this.Menu = this.mainMenu1;
this.Name = "WinForm";
this.Text = "WinForm";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bdpDataAdapter1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataSetau)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new WinForm());
}
/// <summary>
/// menuItem2_Click
/// </summary>
private void menuItem2_Click(object sender, System.EventArgs e)
{
this.sqlConnection1.Open();
this.sqlDataAdapter1.Fill(this.dataSet11);
this.sqlConnection1.Close();
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
this.menuItem2.PerformClick() ;
this.menuItem2_Click(null,null);
}
}
}
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Windows.Forms.DataGrid dataGrid1;
private DelDotNet.DataSet1 dataSet11;
private System.Windows.Forms.MenuItem menuItem3;
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataSet11 = new DelDotNet.DataSet1();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).begin
Init();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).begin
Init();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem3});
this.menuItem1.Text = "hello";
//
// menuItem2
//
this.menuItem2.Checked = true;
this.menuItem2.Index = 0;
this.menuItem2.RadioCheck = true;
this.menuItem2.Text = "yes";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "all";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "integrated security=SSPI;data source=/"./";persist security info=Fal"
+
"se;initial catalog=pubs";
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "select * from Titles";
this.sqlSelectCommand1.Connection = this.sqlConnection1;
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
//
// dataGrid1
//
this.dataGrid1.AlternatingBackColor = System.Drawing.Color.Lavender;
this.dataGrid1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.BackgroundColor = System.Drawing.Color.LightGray;
this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.LightSteelBlue;
this.dataGrid1.CaptionForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.DataMember = "";
this.dataGrid1.DataSource = this.dataSet11._Table;
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid1.ForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.GridLineColor = System.Drawing.Color.Gainsboro;
this.dataGrid1.GridLineStyle = System.Windows.Forms.DataGridLineStyle.None;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.HeaderForeColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.LinkColor = System.Drawing.Color.Teal;
this.dataGrid1.Location = new System.Drawing.Point(0, 0);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.Gainsboro;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.CadetBlue;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.Size = new System.Drawing.Size(792, 370);
this.dataGrid1.TabIndex = 0;
//
// dataSet11
//
this.dataSet11.DataSetName = "DataSet1";
this.dataSet11.Locale = new System.Globalization.CultureInfo("zh-CN"
;
this.dataSet11.Namespace = "http://www.changeme.now/DataSet1.xsd";
//
// WinForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(792, 370);
this.Controls.Add(this.dataGrid1);
this.Menu = this.mainMenu1;
this.Name = "WinForm";
this.Text = "WinForm";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
this.ResumeLayout(false);
}