Why would this code not update the local MS Access database?
-
{ // // add whiskey from menu string connection = @" Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Database.accdb"; OleDbConnection conn = new OleDbConnection(connection); try { conn.Open(); } catch (Exception) { MessageBox.Show("Did Not Connect"); } OleDbCommand command = new OleDbCommand(); command.CommandType = System.Data.CommandType.Text; command.CommandText = "UPDATE Alcohol SET Quantity = '90000' WHERE Type = 'Whiskey'"; command.Connection = conn; command.ExecuteNonQuery(); Using C# trying to get this to change a field in the database.. it isn't throwing any errors.. but, it isn't changing the database either.. any ideas on how I could get this working right?
-
Answer:
If it's not throwing any errors then it must not be finding any records that match your criteria. Are you sure that Type would contain "Whiskey" Is it possible that it has another value stored like a key to another file that containes type descriptions?
Nameless at Yahoo! Answers Visit the source
Related Q & A:
- How to convert my SQL query to MS Access query?Best solution by Stack Overflow
- How to synchronize Server Database and Local SQLite?Best solution by Stack Overflow
- How to do a local mysql database replication on an online server?Best solution by howtoforge.com
- Why will my feeds not update on my yahoo 360 page?Best solution by Yahoo! Answers
- How to connect php file to ms access?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.