C# 通过存储过程实现员工ID自动编号
代码说明:
C# 实现自动ID,通过存储过程实现员工自动编号,这个在平时的编程中很实用,自动编号使用存储过程来实现,比较高级一些,且数据库需要支持存储过程。 con.Open(); SqlCommand cmd = new SqlCommand(); string strSql = "insert into 员工个人信息 values ( + label6.Text + , + this.textBox2.Text + , + this.textBox3.Text + , + this.textBox5.Text + , + this.textBox4.Text + )"; cmd.CommandText = strSql; cmd.Connection = con; cmd.ExecuteNonQuery(); con.Close(); MessageBox.Show("成功添加信息"); this.groupBox1.Enabled = false;
下载说明:请别用迅雷下载,失败请重下,重下不扣分!