内容发布更新时间 : 2025/5/2 8:25:12星期一 下面是文章的全部内容请认真阅读。
{
this.用户表TableAdapter.Fill(this.火车票管理系统DataSet.用户表); SqlConnection conn = new SqlConnection();
conn.ConnectionString = \Source=2013-20141011IV;Initial Catalog=火车票管理系统;User
ID=sa;Password=123456\
conn.Open();
String cmdStr = \用户表 where 用户号= '\ SqlCommand sqlCom = new SqlCommand(cmdStr, conn); SqlDataAdapter myadap = new SqlDataAdapter(); myadap.SelectCommand = sqlCom; DataSet myset = new DataSet(); myadap.Fill(myset, \用户表\
this.dataGridView1.DataSource = myset.Tables[\用户表\ } //用户注册
private void btnconfirm_Click(object sender, EventArgs e) {
if (this.txtusername.Text == \ {
MessageBox.Show(\用户名不能为空!\提示!\ return; }
if (this.txtname.Text == \ {
MessageBox.Show(\姓名不能为空!\提示!\ return; }
if (this.cbsex.Text == \ {
MessageBox.Show(\性别不能为空!\提示!\ return; }
if (this.txtpw.Text == \ {
MessageBox.Show(\密码不能为空!\提示!\ return; }
if (this.txtpwagain.Text != this.txtpw.Text) {
MessageBox.Show(\确认密码必须和密码一致\提示!\ return; }
if (this.txtidentity.Text == \
32
{
MessageBox.Show(\身份证号码不能为空!\提示!\ return; } try {