//// delete from 课程表 where 课程号=1 or 1=1
            string sql = this.textBox1.Text.Trim();

            System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection("Data Source=127.0.0.1;Initial Catalog=Student;User ID=sa;PassWord=58");

            System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("delete from 课程表 where 课程号=" + this.textBox1.Text.Trim(), con);

            cmd.CommandType = CommandType.Text;

            con.Open();
            int changeline = cmd.ExecuteNonQuery();
            con.Close();

            label2.Text = "数据库更改行数" + changeline.ToString();

posted on 2008-03-01 23:33  阿春  阅读(164)  评论(0)    收藏  举报