I am writing a small college app, a video rental app. I have no problem reading from the database, but I cannot update the data in the tables.
In particular, I want to update the camera by showing the amount of film in the warehouse after someone rents the film.
So far I have tried to do 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 am not getting any errors, but the cell is not updating in the table. Any help would be greatly appreciated, please let me know if you need further information.
UPDATE:
Well, I have some interesting developments, I updated the code:
string updateDVDs = "UPDATE Products SET dvd_quantity = " + product.Quantity + " WHERE title = '" + product.Name + "'";
dBConnection = new SqlCeConnection(connectionString);
cmdUpdateDVDs = new SqlCeCommand(updateDVDs, dBConnection);
cmdUpdateDVDs.Connection.Open();
int rows = cmdUpdateDVDs.ExecuteNonQuery();
dBConnection.Close();
, , MSDN, , , , .
, "Die Hard", , :

, , .
"Die Hard" , , , ! DVD- 0, :

, Product Visual Studio, :

, Visual Studio, DVD reset , .
- ? , .
Visual Studio, , , , , , .