SqlCommand.Parameters中的參數變量要在前面加@
如:
myCommand.CommandText = "SELECT CustomerID, CompanyName FROM Customers WHERE Country = @Country AND City = @City";
OracleCommand.Parameters中的參數變量要在前面加:
如:
myCommand.CommandText = "UPDATE test SET test1 =:test1, test2 =:test2 WHERE id = :id";
OleDbCommand 或 OdbcCommand 是蟈蟈總結的.
如:
myCommand.CommandText = "SELECT CustomerID, CompanyName FROM Customers WHERE Country = ? AND City = ?";
SqlCommand,OracleCommand,OleDbCommand 或 OdbcCommand
最新推荐文章于 2021-04-13 16:16:28 发布