| Код | using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
namespace WindowsApplication3 { public class Form1 : System.Windows.Forms.Form { private System.Data.Odbc.OdbcDataAdapter odbcDataAdapter1; private System.Data.Odbc.OdbcCommand odbcSelectCommand1; private System.Data.Odbc.OdbcConnection odbcConnection1; private WindowsApplication3.DataSet1 dataSet11; private System.Windows.Forms.DataGrid dataGrid1;
private System.ComponentModel.Container components = null;
public Form1() { InitializeComponent(); }
protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); }
#region Windows Form Designer generated code
private void InitializeComponent() { this.odbcDataAdapter1 = new System.Data.Odbc.OdbcDataAdapter(); this.odbcSelectCommand1 = new System.Data.Odbc.OdbcCommand(); this.odbcConnection1 = new System.Data.Odbc.OdbcConnection(); this.dataSet11 = new WindowsApplication3.DataSet1(); this.dataGrid1 = new System.Windows.Forms.DataGrid(); ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); this.SuspendLayout(); // // odbcDataAdapter1 // this.odbcDataAdapter1.SelectCommand = this.odbcSelectCommand1; this.odbcDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { new System.Data.Common.DataTableMapping("Table", "Fam", new System.Data.Common.DataColumnMapping[] { new System.Data.Common.DataColumnMapping("Unic", "Unic"), new System.Data.Common.DataColumnMapping("Fam", "Fam")})}); // // odbcSelectCommand1 // this.odbcSelectCommand1.CommandText = "SELECT Unic, Fam FROM Fam"; this.odbcSelectCommand1.Connection = this.odbcConnection1;
// // odbcConnection1 // this.odbcConnection1.ConnectionString = @"PageTimeout=5;PWD=1;MaxScanRows=8;DefaultDir=D:\Sergey\Doc;FILEDSN=D:\Sergey\Doc\Bases.mdb.dsn;DriverId=25;DBQ=D:\Sergey\Doc\Base.mdb;UserCommitSync=Yes;FIL=MS Access;UID=admin;Driver={Microsoft Access Driver (*.mdb)};MaxBufferSize=2048;Threads=3;SafeTransactions=0"; // // dataSet11 // this.dataSet11.DataSetName = "DataSet1"; this.dataSet11.Locale = new System.Globalization.CultureInfo("ru-RU"); // // dataGrid1 // this.dataGrid1.DataMember = ""; this.dataGrid1.DataSource = this.dataSet11.Fam; this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Location = new System.Drawing.Point(8, 8); this.dataGrid1.Name = "dataGrid1"; this.dataGrid1.Size = new System.Drawing.Size(512, 256); this.dataGrid1.TabIndex = 0; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(528, 273); this.Controls.Add(this.dataGrid1); this.Name = "Form1"; this.Text = "Form1"; ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); this.ResumeLayout(false);
} #endregion
[STAThread] static void Main() { Application.Run(new Form1()); } } }
|
|