How can I update a cell value in a dB table, using SQL Server CE and C# (Visual Studio 2010)
- 阅读更多 关于 How can I update a cell value in a dB table, using SQL Server CE and C# (Visual Studio 2010)
I'm writing a small application for college, a video rental application. I have no problems reading from the database, but I cannot update the data in the tables. In particular I'm looking to update the cell showing the quantity of a film in stock after someone rents a movie. So far I've been trying this: string updateDVDs = "UPDATE Products SET dvd_quantity = " + product.Quantity + " WHERE title = '"+ product.Name +"';"; cmdUpdateDVDs = new SqlCeCommand(updateDVDs, dBConnection); dBConnection.Open(); cmdUpdateDVDs.ExecuteNonQuery(); dBConnection.Close(); I don't get any errors, but the cell