Professional Documents
Culture Documents
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace yjProgressBar
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Button btnLoadData;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.Label lbTime;
private System.Windows.Forms.Timer Clock;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtUnitPrice;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtPName;
private System.Windows.Forms.TextBox txtPId;
public DataSet myDs = new DataSet();
public Form1()
{
//
// 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();
}
}
Page 1 of 5
base.Dispose( disposing );
}
Page 2 of 5
this.lbTime.BackColor = System.Drawing.Color.OliveDrab;
this.lbTime.Font = new System.Drawing.Font("Arial", 12F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
this.lbTime.ForeColor = System.Drawing.Color.Brown;
this.lbTime.Location = new System.Drawing.Point(8, 232);
this.lbTime.Name = "lbTime";
this.lbTime.Size = new System.Drawing.Size(72, 23);
this.lbTime.TabIndex = 2;
this.lbTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Clock
//
this.Clock.Enabled = true;
this.Clock.Interval = 1000;
this.Clock.Tick += new System.EventHandler(this.Timer_Tick);
//
// txtPName
//
this.txtPName.Location = new System.Drawing.Point(184, 104);
this.txtPName.Name = "txtPName";
this.txtPName.ReadOnly = true;
this.txtPName.Size = new System.Drawing.Size(168, 20);
this.txtPName.TabIndex = 6;
this.txtPName.Text = "";
//
// txtPId
//
this.txtPId.Location = new System.Drawing.Point(184, 72);
this.txtPId.Name = "txtPId";
this.txtPId.ReadOnly = true;
this.txtPId.Size = new System.Drawing.Size(168, 20);
this.txtPId.TabIndex = 6;
this.txtPId.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(96, 72);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 16);
this.label1.TabIndex = 5;
this.label1.Text = "ProductID";
//
// label4
//
this.label4.Location = new System.Drawing.Point(88, 136);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(80, 16);
this.label4.TabIndex = 5;
this.label4.Text = "UnitPrice";
//
// txtUnitPrice
//
this.txtUnitPrice.Location = new System.Drawing.Point(184, 136);
this.txtUnitPrice.Name = "txtUnitPrice";
this.txtUnitPrice.ReadOnly = true;
this.txtUnitPrice.Size = new System.Drawing.Size(168, 20);
Page 3 of 5
this.txtUnitPrice.TabIndex = 6;
this.txtUnitPrice.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.SystemColors.Info;
this.ClientSize = new System.Drawing.Size(416, 285);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.label4,
this.label3,
this.txtUnitPrice,
this.txtPName,
this.txtPId,
this.label1,
this.statusBar1,
this.btnLoadData,
this.progressBar1,
this.lbTime});
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
String mySql;
String myConnStr;
Page 4 of 5
// build the connection string
myConnStr = "User ID=sa; Initial Catalog = jyNWDB;Data
Source=yourdatasource;Password=yourpassword";
Page 5 of 5