Freigeben über


Working with a Local Database File in Visual Studio

In this post and video I’ve shown folks how to work with a local database file (.mdf, .mdb, .sdf) that resides directly inside your project in order to see updates made while debugging your application. If it looks like everything saves fine while debugging, but you can’t see the updates if you look directly in the database, then there’s a simple fix. Today the VS Data Team wrote up a great blog post on this as well so check it out!

In general I prefer to develop against attached SQL Server databases because it’s easier to debug. But if you’re working with SQL Compact or Access databases you’ll need to be aware of how the database file is copied out with your application EXE and what file you are really working with.

Enjoy!

Comments

  • Anonymous
    August 04, 2009
    Can you talk about local Crystal reports and how to modify the sql query used by the report without re-designing and rewriting the report?  We ran into that problem with VS 2008.

  • Anonymous
    August 04, 2009
    Hi Greg, Sorry but I've never worked with Crystal reports, only SQL Reporting Services. -B

  • Anonymous
    August 15, 2009
    Thanks Beth. I hope to see something from you concerning integrating VB with Sharepoint. Once more, you rule :-)

  • Anonymous
    August 17, 2009
    Hi Waleed, Check out this series for a simple end-to-end example of an Office business application including a SharePoint workflow here: http://blogs.msdn.com/bethmassi/archive/2009/04/21/oba-part-5-building-the-sharepoint-2007-workflow.aspx What exactly are you looking for? Cheers, -B

  • Anonymous
    June 02, 2011
    How do i publish my VB SQL project, so that it works fine on client machines without complaining that the DB is not on the machine?

  • Anonymous
    February 10, 2012
    Is there an updated Process on this I am working with VS 2010 Pro and a local database seems to be SQL compact (.sdf file) and it seem to not be storing the data. I have followed your videos several times...no luck Can you still choose a SQL Express database ? if so any hints any info or articles you could offer would be great Thank you

  • Anonymous
    February 29, 2012
    Beth, Im Working With A Local Database sql3.5, i'm trying to get the database to automatically times quanity * units as a sum. I just can't figure it out. Any help is appreciated. thanks

  • Anonymous
    January 26, 2013
    my local database of visual studio 2008 is not working so what can i do for it please tell me

  • Anonymous
    February 06, 2013
    how can i create two table and do relationship between them in local database in visual studio 2008

  • Anonymous
    March 21, 2013
    Hi, I want to use the database in such way so that where I deploy my desktop application it will take the Database which resided into Application. I dont want to set/change the connectionstring everytime whereever I will install my application. Can you help me. How will I proceed?