我想通过多列值检查从 SQL 表中删除一行。我知道如何处理单列值:
SqlConnection connection = new SqlConnection("YourDatabaseConnectionString");
string sqlStatement = "DELETE FROM Customers WHERE ColumnID = @ColumnID";
try{
connection.Open();
SqlCommand cmd = new SqlCommand(sqlStatement, connection);
cmd.Parameters.AddWithValue("@ColumnID", "SomeValueHere");
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
}
finally {
connection.Close();
}
但是,多列值检查的语法是什么?另外,如果它们是 Date (SQL) 和 Time7 (SQL) 格式,我应该如何格式化这些值?