毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

ASP.NET客户信息管理系统的开发(14)

时间:2016-11-27 21:00来源:毕业论文
SqlCommand cmd1 = new SqlCommand(sql, conn); if (cmd1.ExecuteScalar() == null) { MessageBox.Show(查无资料,请输入); button1.Enabled = true; return; } else { textBox1.Text = cmd1.ExecuteScalar(


            SqlCommand cmd1 = new SqlCommand(sql, conn);
            if (cmd1.ExecuteScalar() == null)
            {
                MessageBox.Show("查无资料,请输入");
                button1.Enabled = true;
                return;
            }
            else
            {
                textBox1.Text = cmd1.ExecuteScalar().ToString();
                button5.Enabled = true;
                button3.Enabled = true;
            }
2)添加信息
if (textBox1.Text == "")
            {
                MessageBox.Show("请输入投诉信息");
                return;
            }
            else
            {
                sqlConnect();
                string sq2 = "insert into tousu values('" + comboBox1.Text.Trim() + "','" + textBox1.Text.Trim() + "' )";
                SqlCommand cmd2 = new SqlCommand(sq2, conn);
                cmd2.ExecuteNonQuery();
                sqlClose();
                MessageBox.Show("添加成功");
            }
 
3)修改信息
if (textBox1.Text =="")
            {
                MessageBox.Show("请输入投诉信息");
                return;
            }
            else
            {
                sqlConnect();
                string sq4 = "update tousu set liyou='" + textBox1.Text.Trim() + "'where custormid='" + comboBox1.Text + "'";
                SqlCommand cmd4 = new SqlCommand(sq4, conn); ASP.NET客户信息管理系统的开发(14):http://www.751com.cn/jisuanji/lunwen_460.html
------分隔线----------------------------
推荐内容