SqlConnection a = new SqlConnection();
a.ConnectionString = "server=localhost;uid=sa;pwd=;database=pubs";
a.Open();
string sql = "insert into userinfo Values('" + this.textBox1.Text + "')";
SqlCommand ab = new SqlCommand(sql, a);
ab.ExecuteNonQuery();
MessageBox.Show("添加成功");