打印本文 打印本文 关闭窗口 关闭窗口
通过c#连结oracle数据库(三)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3077  更新时间:2009/4/22 22:10:38  文章录入:mintao  责任编辑:mintao

//

this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);

this.ClientSize = new System.Drawing.Size(576, 317);

this.Controls.AddRange(new System.Windows.Forms.Control[] {

this.BtnExit,

this.BtnDelete,

this.BtnEdit,

this.BtnSave,

this.BtnAddNew,

this.TxtDeptNo,

this.TxtESal,

this.TxtEName,

this.TxtEmpNo,

this.label4,

this.label3,

this.label2,

this.label1});

this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));

this.Name = "FrmEmp";

this.Text = "Employee Data Form";

this.Load += new System.EventHandler(this.FrmEmp_Load);

this.ResumeLayout(false);

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main()

{

Application.Run(new FrmEmp());

}

private void FrmEmp_Load(object sender, System.EventArgs e)

{

}

private void BtnExit_Click(object sender, System.EventArgs e)

{

Conn.Close();

this.Close();

}

private void BtnAddNew_Click(object sender, System.EventArgs e)

{

TxtEmpNo.Text = "";

TxtEName.Text = "";

TxtESal.Text = "";

TxtDeptNo.Text = "";

TxtEmpNo.Focus();

}

private void BtnSave_Click(object sender, System.EventArgs e)

{

try

{

if (blnEdit == false)

{

DataRow1 = DataSet1.Tables["Emp"].NewRow();

DataRow1["EmpNo"] = Int16.Parse(TxtEmpNo.Text);

DataRow1["EName"] = TxtEName.Text;

DataRow1["Sal"] = Double.Parse(TxtESal.Text);

DataRow1["DeptNo"] = Int32.Parse(TxtDeptNo.Text);

DataSet1.Tables["Emp"].Rows.Add(DataRow1);

DataAdpt.Update(DataSet1,"Emp");

 

MessageBox.Show("record saved!");

}

[1] [2] [3] [4]  下一页

打印本文 打印本文 关闭窗口 关闭窗口