none
Local and remote database RRS feed

  • Question

  • Hi,

     

    I have a windows application that when installed on an end-users computer a local copy of SQL Server Express is installed. When I created the application using VB.Net I chose to copy the database to the project folder by default.

     

    So everything is working locally but I want to put a copy of SQL Server Express on a server with the same database schema so that end-users can manage information locally and then merge the data to the server once they are connected to the network using a simple button press event. Any idea how I would go about this?

     

    Also other people might merge there local data as well so before going out in the field so I need a way of updating the local copy from the server.

     

    My final question is regarding my application install. When I run the setup.exe everything installs and the database connection works great but what if i am out in the field with no network connection and I need to intall the application on another computer (this will install a blank copy of the database). I can't find the .mdf file once I install the application to move it to the freshly installed computer so that the data is available.

     

    I hope this all makes sense

     

    Thanks for any help

     

     

    Wednesday, November 28, 2007 10:29 PM

Answers

  •  

    (Here is the basic path to the installed applications using click once

    C:\Documents and Settings\user name\Local Settings\Apps\2.0\Q6WYK18P.L3H\H3NRC1B9.HK0)

     

     

    This is only SQL Server Express because you cannot put regular SQL Server database in your document folder.

     

    Tuesday, December 4, 2007 7:42 PM

All replies

  • Sounds like you want to implement SQL Server Replication.

     

    I don't think I understand your last question. If it's a local installation then why would a network connection be required?
    Friday, November 30, 2007 1:55 PM
  • SQL Server Express can only be used as subscriber in replication but some of your needs also require data compare something you can only get from VS2005 for database developer or third party tools like RedGate Data Compare.  And your last question, you need to write code that backup and restore your database during deployment or attach your database during deployment.  The short answer you need SQL Server that cost money to perform the tasks you have listed.

     

    http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx 

     

    http://msdn2.microsoft.com/en-us/vstudio/aa718806.aspx

     

    Tuesday, December 4, 2007 7:25 PM
  • I think for your last question you are looking for the application install location to find your database that is being used in the installed app so that you can find it and copy it with the data.

     

    Here is the basic path to the installed applications using click once

    C:\Documents and Settings\user name\Local Settings\Apps\2.0\Q6WYK18P.L3H\H3NRC1B9.HK0

     

    i believe this is the basic path where your application's data folder will be which will contain your database

    C:\Documents and Settings\user name\Local Settings\Apps\2.0\Data\EWDPGZJJ.W2W\48CTVQCP.9WY

     

    yours may be different on both of the above

     

     

    you can also use application.startuppath to find the path

    msgbox(application.startuppath.tostring)

     

     

    these are the application data paths that you can use also

     

    System.Windows.Forms.Application.CommonAppDataPath

    System.Windows.Forms.Application.LocalUserAppDataPath

    System.Windows.Forms.Application.ExecutablePath

    System.Environment.SpecialFolder.LocalApplicationData

    System.Environment.SpecialFolder.CommonApplicationData

     

    Tuesday, December 4, 2007 7:38 PM
  •  

    (Here is the basic path to the installed applications using click once

    C:\Documents and Settings\user name\Local Settings\Apps\2.0\Q6WYK18P.L3H\H3NRC1B9.HK0)

     

     

    This is only SQL Server Express because you cannot put regular SQL Server database in your document folder.

     

    Tuesday, December 4, 2007 7:42 PM