CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2011
    Posts
    10

    Forms application background database

    I'm coding a server/client program so that multiple clients can connect to the server and access the information that I want to store. I have the server/client relationship setup with a WCF service hosted inside a windows service for a server and a forms client that connects to it and calls the functions the service offers.

    My problem is, I need to deploy a database with the server side install and I'm unsure on how to do that. From just browsing the options in Visual Studio I can add an MDF database to the project and build the app that way and have the installer install SQL express, but I don't know if that is the right way. Just seems to me that an MDF sitting in the install directory for the program doesn't look correct, I've never seen anything else done like that. Also, when I have a database correctly added to the project and deployed, how do I update that database? The GUI and libraries are a simple overwrite, but when the server has real data in it, it can't just start over every time an update goes out.

    Any insight on this would be greatly appreciated. Thanks in advance.

  2. #2
    Join Date
    Jun 2011
    Posts
    10

    Re: Forms application background database

    Does anyone have any suggestions for this?

  3. #3
    Join Date
    Dec 2009
    Posts
    109

    Re: Forms application background database

    If I'm not wrong, you're supposed to attach the database to the server. Ofcourse, you need to have SQL Server Management Studio installed for that because Visual Studio doesn't facilitate it.

  4. #4
    Join Date
    Jun 2011
    Posts
    10

    Re: Forms application background database

    Quote Originally Posted by Dragster93 View Post
    If I'm not wrong, you're supposed to attach the database to the server. Ofcourse, you need to have SQL Server Management Studio installed for that because Visual Studio doesn't facilitate it.
    The database is added to the server project and I can manage it with management studio installed. My question is that when compiled the MDF is part of the output files and I've really never seen any programs come with an MDF in their installation directory. Also the other part that confused me was how to update the structure of the database during a program update so as to not overwrite any data the user(s) already have stored in a deployed environment.

  5. #5
    Join Date
    Jun 2011
    Posts
    10

    Re: Forms application background database

    Just gonna bump this up and see if anyone else has any other insight. Still trying to work on this project. Been researching forms apps with database backgrounds and can't really find any other types of implementation, but I still don't feel like this is the correct way of doing this. Nor have I found a way to execute structure changes in a program update for already established databases.

  6. #6
    Join Date
    Dec 2011
    Posts
    61

    Re: Forms application background database

    to have a mdf attached to your application is actually using sql server compact edition. usually it's not suitable for server side. better have sql server expression edition or above, which is normally installed manually. if you mean to initialize your db, you need to create a sql script to run against your sql server.

  7. #7
    Join Date
    Jun 2011
    Posts
    10

    Re: Forms application background database

    Sorry that I'm not responding for awhile. This type of confusing problem is something that causes me to lose interest in a project that I don't have a deadline for.

    I need to install my application with an initial MDF, which will not use compact edition, I'm going to install express in my installer package and attach the DB to the express installation. Then, if I run an update, I need a way from the installer to run structure updates to the DB from an SQL file. Can anyone recommend an installer to do this and how I might use it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured