Results 1 to 9 of 9

Thread: How to deploy vb.net project with SQL Server 2014 Database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2013
    Posts
    17

    How to deploy vb.net project with SQL Server 2014 Database

    I developed a VB.net application with an SQL Server 2014 Database using Visual Studio 2013. I need to know how make anexe file that runs on other computer using the database

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to deploy vb.net project with SQL Server 2014 Database

    There's only one way to create an EXE and the fact that you're using a SQL Server 2014 database is irrelevant to that. You build your project and that compiles the source and outputs an EXE. That's it. You can deploy that EXE to another machine in various ways. You may also need to deploy other files with your EXE, with the database or files to build the database being included in that.

    There are also a number of ways that you could be using a SQL Server database. Have you added an MDF file directly to your project or did you create a database that is attached to a SQL Server instance? If you're not sure, show us your connection string and we should be able to work it out from that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2013
    Posts
    17

    Re: How to deploy vb.net project with SQL Server 2014 Database

    My connection String is Data Source=JOES-PC\SQLEXPRESS;Initial Catalog=desbloquealo;Integrated Security=True

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to deploy vb.net project with SQL Server 2014 Database

    Quote Originally Posted by joecruz36 View Post
    My connection String is Data Source=JOES-PC\SQLEXPRESS;Initial Catalog=desbloquealo;Integrated Security=True
    That means that you're connecting to a permanently attached database, so the database itself is not part of your project. What is the relationship between the client application and the database supposed to be? If there are supposed to be multiple clients to one database then what you have is appropriate. If there's only one client but the database will or might be on a remote server then what you have is appropriate. If there's only one client and the database is going to be on the same machine then what you have is not wrong but it might be better to take the other option and use a database that is part of your project and attached on demand.

    As you have it now, the database will need to be created separately, probably by running one or more scripts. If you use the other option, the database file simply gets deployed with your EXE. As long as SQL Server Express is installed, which can be done automatically with an installer, it will just work.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2013
    Posts
    17

    Re: How to deploy vb.net project with SQL Server 2014 Database

    For now I would like to deploy the app in another computer with the database. Later I will need the app installed on five computers and the database in one of them. This project is for a cel phone repair store which will need up to five computers sharing the app and the database.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to deploy vb.net project with SQL Server 2014 Database

    Quote Originally Posted by joecruz36 View Post
    For now I would like to deploy the app in another computer with the database. Later I will need the app installed on five computers and the database in one of them. This project is for a cel phone repair store which will need up to five computers sharing the app and the database.
    In that case, the application deployment and the database deployment will be separate, because needs to be done multiple times and the other needs to be done only once.

    Each time you build your project, you're already creating an EXE. That and any other files you need to deploy should be found in your output folder. If you're deploying for real then you should create a Release build, rather than the Debug build you use during development. You can simply copy the output to another machine if you like, or publish the project to create a ClickOnce installer or use some other deployment tool, e.g. InstallShield. An installer can do certain things automatically that might otherwise be manual, e.g. making Registry changes.

    To deploy the database, you would probably choose one of three options:

    1. Generate one or more SQL scripts from your database and execute them on the database server. The easiest way to generate the script(s) is using Management Studio. The SQL Server tools in VS may be able to do it as well but I've never tried.

    2. Create a backup of an existing database and then restore that on the database server.

    3. Copy the MDF data file and attach that on the database server.

    I'd go with option 1 in most cases.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    Junior Member
    Join Date
    May 2013
    Posts
    17

    Re: How to deploy vb.net project with SQL Server 2014 Database

    Sorry I'm new to this and don't understand much things. The computer I'm trying to get the app running is not connected to any database server. I installed the exe file but dont know how to attach the mdf file. Dont understand or dont know how to perform any of your suggested steps.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to deploy vb.net project with SQL Server 2014 Database

    Sorry, I'm not here to teach the fundamentals. I suggest that you do some research and then post back when you encounter an actual issue.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9
    Frenzied Member IanRyder's Avatar
    Join Date
    Jan 2013
    Location
    Healing, UK
    Posts
    1,232

    Re: How to deploy vb.net project with SQL Server 2014 Database

    Hi,

    What you are referring to is typically know as a Client/Server Setup. Have a watch of this youtube video which may help you to understand what you need to do next:-

    Understanding Client Server Architecture

    Hope that helps.

    Cheers,

    Ian

Tags for this Thread

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