Cannot see table data when I choose Show Table Data RRS feed

  • Question

  • I am using Visual C# 2008 Express.
    I have an SQL database in my app. I have populated it via a datacontext object. The code runs as expected. The frist time it inserted the data because the key was not found. Subsequent running skip insertions because the key is found. I can view the data with the debugger. The mdf file on disc is a couple megs in size. The properties page shows the same file location for the table. But when I choose "Show Table Data" from the context menu it displays an empty table. What's going on here?
    Tuesday, January 5, 2010 8:20 PM


All replies

  • Post some code of what you are doing.

    When your application first opens is the database always empty?  I suspect that it is.

    You need to make sure that you are examining the same copy of the file that the code is using.

    Mark the best replies as answers. "Fooling computers since 1971."
    • Proposed as answer by Louis.fr Wednesday, January 6, 2010 9:47 AM
    Tuesday, January 5, 2010 9:13 PM
  • No, as I meant when I said Subsequent running skips insertions. As soon as the DataContext object is created I can inspect it in the debugger and it has data in it.
    Tuesday, January 5, 2010 11:46 PM
  • I think you should look into bin\Debug. I'm sure you'll find a copy of your db in it. That's the db you're working on and the one your program uses.

    Same problem here : http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/04a1af06-136a-484d-8e3c-f6526c24d7c4
    • Marked as answer by Omnoculus Wednesday, January 6, 2010 3:14 PM
    Wednesday, January 6, 2010 9:35 AM
  • Thanks Louis, I suspected as much but, bizarrely, the copy of the db in the dev dir and the copy in the debug dir are exactly the same size.
    Wednesday, January 6, 2010 3:14 PM