Visual Basic 2005 Express Edition Database Explorer does not show updates to database.

I am running Visual Basic 2005 Express Edition with SQL Server 2005 Express Edition. The project I am working on has the feature which copies the Database into the Bin folder turned off. I manually copied the database into this folder some time ago. This has not been a source of problem/s for me.

My application is working. I determined this by steping through the code and examining the appropriate variables.

I change a table column.

I then update the database using the dataadapter update method.

The updated row count returned is what I expected. There are no exceptions raised.

I can then retrieve the database data into a variable. The value is what I expected.

So all appears to be working just as expected.

However, using the IDE I change over to the Database Explorer and select the table I just updated. I then use the feature called "Show Table Data" on the table just successfully updated. What I see in the table row which was selected is the original value of the column before I updated it.

Simply put. The Database Explorer is not showing the "current" table values.

Why is this

Thanks for any and all help/guidance etc.

Gary




Answer this question

Visual Basic 2005 Express Edition Database Explorer does not show updates to database.

  • zjorks

    Again Shakalama I want to thank you.

    First my problem is solved, but the solution may not be exactly what you expect.

    I reread a thread you posted, maybe a little more carefully.

    In the IDE, opening database explorer, it showed my defined database.

    Next, in my IDE using solution explorer, under the root assemble, I found my database. Right clicking on it I selected properties and modified the appropriate one to "Copy when newer". This I understand allows this specific DB to only be copied to my bin folder when it's DB structure is modified.

    Next in solution explorer, I click the button which shows all active files. This allows me to see the bin folder.

    In the bin folder, I found the database file and right clicked on it. I selected "Open". This now shows another database in the database explorer window with a suffix of .mdf1.

    At this point, I now have two databases showing in the database explorer window. I have xxx.mdf AND xxx.mdf1.

    When I right click on the appropriate table in xxx.mdf1 and select "show table data", I am now able to see the data which contains my changes. This is of course the database which is housed in the bin folder.

    Problem solved.

    The reason earlier that I could not see my data changes was because I was always selecting "View" from the main menu bar and then selecting "Database Explorer" which always opened showing the xxx.mdf database file.

    However, once both databases can be seen in the Database Explorer, it appears from that point forward you will continue to be able to see both databases when selecting from "View" off the main menu bar. Even after closing and then re-opening the project.

    Wow, that is great. But certainly not intuitive.

    Again, thanks for getting me pointed in the right direction for finding the solution to this problem.



  • Pontus Bergquist

    hi,

    when you publish your application the database that in your project folder is the one that will be published ,

    the other one in debug folder is just for testing so that you IDE override it every time you start to debug you app by default. because you shouldn't depend on this by any means.

    this question always come for curiosity (what happend to my new row that i added to my database why i can't see it ) and the answer for that question is just to make them feel safe but you shouldn't depend on the database that in your debug folder

    best regards



  • LimitedSlip

    hi,

    yes i know you don't have to shutdown your computer or ide, simply because you your IDE open the database in your project folder(that appear in your solution explorer)

    but when you run your computer and testing you run the database in (your project folder / bin / debug) so your records have been added to different database not the one in your solution explorer

    now

    1) run your application and make some changes in your data and stop your project

    2) go to your (project folder / bin / debug) copy the database there

    3) go up to your project folder and past the database to replace the original one

    4) open your database in your ide

    5) you will find the changes you made occured

    hope this helps



  • Robert McNeal

    hi,

    take a look to this thread

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=213735&SiteID=1

    hope this helps



  • steve17

    Thanks Shakalama. I took a look at the thread you referenced, but feel it is not applicable.

    My problem is not between shutdowns and startups of the IDE. My problem is during a continuous IDE session.

    a. I open "show table data" in database explorer.

    b. I look at the row data

    c. I run my app in the IDE and it says it successfully updates the DB

    d. I open "show table data" in database explorer.

    e. I look at the row data

    f. There is no change to what I saw originally

    g. I run my app to retrieve the updated data AND actually get the updated data. Debug process verifies this for me.

    This makes me think that the "show table data" is not looking at the database which is being updated.

    Thank you for your speedy response. I am aware of the issue addressed by the referenced thread and have prior to this problem addressed that issue.

    Again, Thank You!!

    Gary



  • Visual Basic 2005 Express Edition Database Explorer does not show updates to database.