Hello all,
When accessing records through a basic datagridview that has a bindingnavigator in VS 2005, changes made do not save to the database even though I click the save button and no errors occur.
The database is attached from the application folder and uses the below connection string:
But if I physically attach the MDF to the database through SQL Server Management Studio and then connect to it in the application, the databases saves and reflects any Updates, Deletes, and Inserts that were saved. I do delete the database before trying the attach method again to avoid the database name already existing on the server. Here is the connection string:
I'm trying to figure out how to make it work correctly when it is attached at runtime since I need the database distributed with the app.
One clue which may not be relevant: When I click on the database file connection in Server Explorer, the "Disconnected" X turns into a "plug" connection. But right when I click "Start Debugging", I see it turn back into an X.
Again, the app runs fine, no errors that I can see. Just changes are not saving with the attach method in the connection string.
When accessing records through a basic datagridview that has a bindingnavigator in VS 2005, changes made do not save to the database even though I click the save button and no errors occur.
The database is attached from the application folder and uses the below connection string:
Code:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\OMS.mdf;Integrated Security=True;User Instance=FALSE
Code:
Data Source=.\SQLEXPRESS;Initial Catalog=OMS;Integrated Security=True
One clue which may not be relevant: When I click on the database file connection in Server Explorer, the "Disconnected" X turns into a "plug" connection. But right when I click "Start Debugging", I see it turn back into an X.
Again, the app runs fine, no errors that I can see. Just changes are not saving with the attach method in the connection string.