C#数据库编程中,如何编写删除一行记录的代码?
这是我目前写的代码,请大家在基础上帮我修改完善一下谢谢!SqlConnectionConn=newSqlConnection();Conn.Open();SqlConne...
这是我目前写的代码,请大家在基础上帮我修改完善一下谢谢!
SqlConnection Conn = new SqlConnection();
Conn.Open();
SqlConnection conn = new SqlConnection();
string connString = "Data Source=PC201311011615;Initial Catalog=地面信息数据库-Database;Integrated Security=True";
string deleteQuery = "DELETE FROM house where hno= " + textBox1.Text;
conn.ConnectionString = connString;
SqlCommand mycommand = new SqlCommand(deleteQuery, conn);
mycommand.ExecuteNonQuery(); 展开
SqlConnection Conn = new SqlConnection();
Conn.Open();
SqlConnection conn = new SqlConnection();
string connString = "Data Source=PC201311011615;Initial Catalog=地面信息数据库-Database;Integrated Security=True";
string deleteQuery = "DELETE FROM house where hno= " + textBox1.Text;
conn.ConnectionString = connString;
SqlCommand mycommand = new SqlCommand(deleteQuery, conn);
mycommand.ExecuteNonQuery(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询