⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winform.pas.~3~

📁 Delphi 2005程序设计教程_实例源文件和教学课件
💻 ~3~
📖 第 1 页 / 共 4 页
字号:
unit WinForm;

interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, Borland.Data.Common, Borland.Data.Provider, 
  DataSet1Unit, System.Globalization;

type
  TWinForm = class(System.Windows.Forms.Form)
  {$REGION 'Designer Managed Code'}
  strict private
    /// <summary>
    /// Required designer variable.
    /// </summary>
    Components: System.ComponentModel.Container;
                dgCustomers: System.Windows.Forms.DataGrid;
                dgOrders: System.Windows.Forms.DataGrid;
                BdpConnection1: Borland.Data.Provider.BdpConnection;
                daCustomers: Borland.Data.Provider.BdpDataAdapter;
                bdpSelectCommand1: Borland.Data.Provider.BdpCommand;
                bdpInsertCommand1: Borland.Data.Provider.BdpCommand;
                bdpUpdateCommand1: Borland.Data.Provider.BdpCommand;
                bdpDeleteCommand1: Borland.Data.Provider.BdpCommand;
                daOrders: Borland.Data.Provider.BdpDataAdapter;
                bdpSelectCommand2: Borland.Data.Provider.BdpCommand;
                bdpInsertCommand2: Borland.Data.Provider.BdpCommand;
                bdpUpdateCommand2: Borland.Data.Provider.BdpCommand;
                bdpDeleteCommand2: Borland.Data.Provider.BdpCommand;
                DataSet11: DataSet1Unit.DataSet1;
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    procedure InitializeComponent;
                procedure TWinForm_Load(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict protected
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    procedure Dispose(Disposing: Boolean); override;
  private
    { Private Declarations }
  public
    constructor Create;
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]

implementation

{$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>
procedure TWinForm.InitializeComponent;
begin
  Self.dgCustomers := System.Windows.Forms.DataGrid.Create;
  Self.dgOrders := System.Windows.Forms.DataGrid.Create;
  Self.BdpConnection1 := Borland.Data.Provider.BdpConnection.Create;
  Self.daCustomers := Borland.Data.Provider.BdpDataAdapter.Create;
  Self.bdpDeleteCommand1 := Borland.Data.Provider.BdpCommand.Create;
  Self.bdpInsertCommand1 := Borland.Data.Provider.BdpCommand.Create;
  Self.bdpSelectCommand1 := Borland.Data.Provider.BdpCommand.Create;
  Self.bdpUpdateCommand1 := Borland.Data.Provider.BdpCommand.Create;
  Self.daOrders := Borland.Data.Provider.BdpDataAdapter.Create;
  Self.bdpDeleteCommand2 := Borland.Data.Provider.BdpCommand.Create;
  Self.bdpInsertCommand2 := Borland.Data.Provider.BdpCommand.Create;
  Self.bdpSelectCommand2 := Borland.Data.Provider.BdpCommand.Create;
  Self.bdpUpdateCommand2 := Borland.Data.Provider.BdpCommand.Create;
  Self.DataSet11 := DataSet1Unit.DataSet1.Create;
  (System.ComponentModel.ISupportInitialize(Self.dgCustomers)).BeginInit;
  (System.ComponentModel.ISupportInitialize(Self.dgOrders)).BeginInit;
  (System.ComponentModel.ISupportInitialize(Self.daCustomers)).BeginInit;
  (System.ComponentModel.ISupportInitialize(Self.daOrders)).BeginInit;
  (System.ComponentModel.ISupportInitialize(Self.DataSet11)).BeginInit;
  Self.SuspendLayout;
  // 
  // dgCustomers
  // 
  Self.dgCustomers.DataMember := '';
  Self.dgCustomers.HeaderForeColor := System.Drawing.SystemColors.ControlText;
  Self.dgCustomers.Location := System.Drawing.Point.Create(8, 8);
  Self.dgCustomers.Name := 'dgCustomers';
  Self.dgCustomers.Size := System.Drawing.Size.Create(440, 160);
  Self.dgCustomers.TabIndex := 0;
  // 
  // dgOrders
  // 
  Self.dgOrders.DataMember := '';
  Self.dgOrders.HeaderForeColor := System.Drawing.SystemColors.ControlText;
  Self.dgOrders.Location := System.Drawing.Point.Create(8, 176);
  Self.dgOrders.Name := 'dgOrders';
  Self.dgOrders.Size := System.Drawing.Size.Create(440, 176);
  Self.dgOrders.TabIndex := 1;
  // 
  // BdpConnection1
  // 
  Self.BdpConnection1.ConnectionOptions := 'transaction isolation=ReadCommit' +
  'ted;blobsize=1024';
  Self.BdpConnection1.ConnectionString := 'assembly=Borland.Data.Mssql, Vers' +
  'ion=2.0.0.0, Culture=neutral, PublicKeyToken=91d62ebb5b0d1b1b;vendorclien' +
  't=sqloledb.dll;database=NorthWind;username=sa;hostname=zhaoyanduo;passwor' +
  'd=sa;provider=MSSQL';
  // 
  // daCustomers
  // 
  Self.daCustomers.Active := False;
  Self.daCustomers.DataSet := nil;
  Self.daCustomers.DataTable := nil;
  Self.daCustomers.DeleteCommand := Self.bdpDeleteCommand1;
  Self.daCustomers.InsertCommand := Self.bdpInsertCommand1;
  Self.daCustomers.SelectCommand := Self.bdpSelectCommand1;
  Self.daCustomers.StartRecord := 0;
  Self.daCustomers.UpdateCommand := Self.bdpUpdateCommand1;
  // 
  // bdpDeleteCommand1
  // 
  Self.bdpDeleteCommand1.CommandOptions := nil;
  Self.bdpDeleteCommand1.CommandText := 'DELETE FROM dbo.Customers WHERE Cus' +
  'tomerID = ? AND CompanyName = ? AND ContactName = ? AND ContactTitle = ? ' +
  'AND Address = ? AND City = ? AND Region = ? AND PostalCode = ? AND Countr' +
  'y = ? AND Phone = ? AND Fax = ?';
  Self.bdpDeleteCommand1.CommandType := System.Data.CommandType.Text;
  Self.bdpDeleteCommand1.Connection := Self.BdpConnection1;
  Self.bdpDeleteCommand1.ParameterCount := (SmallInt(11));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('C' +
      'ustomerIDOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.stFixed, 
        10, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'CustomerID', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('C' +
      'ompanyNameOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        80, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'CompanyName', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('C' +
      'ontactNameOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        60, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'ContactName', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('C' +
      'ontactTitleOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        60, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'ContactTitle', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('A' +
      'ddressOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        120, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'Address', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('C' +
      'ityOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        30, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'City', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('R' +
      'egionOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        30, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'Region', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('P' +
      'ostalCodeOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        20, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'PostalCode', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('C' +
      'ountryOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        30, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'Country', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('P' +
      'honeOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        48, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'Phone', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('F' +
      'axOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 
        48, System.Data.ParameterDirection.Input, False, (Byte(0)), (Byte(0)), 
        0, 'Fax', System.Data.DataRowVersion.Original, nil));
  Self.bdpDeleteCommand1.SchemaName := nil;
  Self.bdpDeleteCommand1.Transaction := nil;
  Self.bdpDeleteCommand1.UpdatedRowSource := System.Data.UpdateRowSource.None;
  // 
  // bdpInsertCommand1
  // 
  Self.bdpInsertCommand1.CommandOptions := nil;
  Self.bdpInsertCommand1.CommandText := 'INSERT INTO dbo.Customers (Customer' +

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -