软件工程课程设计报告(19)

2021-02-21 19:28

SqlConnection thisConnection = new SqlConnection(

"Server=LENOVO-3927D0AD\\SQLEXPRESS;Integrated Security=True;" + "Database=stu");

thisAdapter = new SqlDataAdapter("select f_username[用户名],f_password[密码],f_limit[权限] from t_user", thisConnection);

SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter); thisAdapter.Fill(thisDataSet, "t_user");

dataGridView1.DataSource = thisDataSet.Tables[0]; }

private void button1_Click(object sender, EventArgs e) { try {

SqlConnection thisConnection = new SqlConnection(

"Server=LENOVO-3927D0AD\\SQLEXPRESS;Integrated Security=True;" + "Database=stu"); thisConnection.Open();

SqlCommand thisCommand = thisConnection.CreateCommand();

http://www.77cn.com.cnmandText = "insert into t_user(f_username,f_password,f_limit) values('" +

textBox1.Text.ToString().Trim() + "','" + textBox2.Text.ToString().Trim() + "','" + textBox3.Text.ToString().Trim() + "')"; thisCommand.ExecuteNonQuery();

thisAdapter = new SqlDataAdapter("select f_username[用户名],f_password[密码],f_limit[权限] from t_user", thisConnection); thisDataSet.Clear();

SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter); thisAdapter.Fill(thisDataSet, "t_user");

dataGridView1.DataSource = thisDataSet.Tables[0]; } catch

{ MessageBox.Show("请检查输入格式是否正确?"); } }

private void button3_Click(object sender, EventArgs e) {

SqlConnection thisConnection = new SqlConnection(

"Server=LENOVO-3927D0AD\\SQLEXPRESS;Integrated Security=True;" + "Database=stu"); thisConnection.Open();

SqlCommand thisCommand = thisConnection.CreateCommand();

http://www.77cn.com.cnmandText = "delete from t_user(f_username,f_password,f_limit) values('" +


软件工程课程设计报告(19).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:东南亚 日本

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: