Results 1 to 13 of 13

Thread: How Run SQL Server database 2014 on the user's PC.without Installing Server database

  1. #1

    Thread Starter
    Member
    Join Date
    May 2020
    Posts
    37

    Question How Run SQL Server database 2014 on the user's PC.without Installing Server database

    Hello my friends
    I have been questioned and confused for a while
    I am designing the Visual Basic.net 2015 to Connect Sql Server database 2014
    When designing, I Install the complete Server database on a PC .. but after completing the program, how can I Installing the database(.Mdf and Ldf Files) at the User PC. that will use the program?
    So is there a program to run the database on User PC. without Installing the complete Server database
    It is assumed that there is only a runtime program that is loaded on the user's PC.
    without the need to Install the entire database server on the user's PC.
    Where do I find that program that run the database on the user's PC. .. for SQL Server database 2014

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    They will need SOME form of SQL Server installed... SQL Server Express, SQL Server Developer Edition, SQL Server Enterprise, etc... The Compact Edition (SQLCE) won't suffice though.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    May 2020
    Posts
    37

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    Quote Originally Posted by techgnome View Post
    They will need SOME form of SQL Server installed... SQL Server Express, SQL Server Developer Edition, SQL Server Enterprise, etc... The Compact Edition (SQLCE) won't suffice though.


    -tg
    I did not understand anything .. Is the SQL Server Express enough to install on User PC. ?

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    That's what I said: you'll need SOME form of SQL Server installed... it can be SQL Server Express, SQL Server Developer Edition, SQL Server Enterprise, and so on... Any of those should work. but SQL Server Compact Edition will NOT work.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    SQL Server Express is the route that I'd go. There's no real drawback to that one that I can see.

    It is still possible to use SOME kind of database without installing anything, but those types of databases aren't SQL Server, and will be much more limited. They also won't work with the files you are talking about. For those reasons, I feel that SQL Server Express is just a better option all around. You get a really good database with no cost.
    My usual boring signature: Nothing

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

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    You can't use a SQL Server database without installing SQL Server. As suggested, SQL Server Express is probably what you ought to go for, because it is lighter that Standard and other editions and also because it is free. If someone already has a SQL Server licence and a paid version installed, they can use that without installing Express. There are generally two ways to use SQL Server databases in .NET apps:

    1. The conventional way that has always been available is to have a SQL Server instance installed somewhere on your network - local machine or elsewhere - and have a database permanently attached to that instance. You can create a database on an instance using SQL Server Management Studio (SSMS) or some other tool. The instance will then create the required data files and manage them. You generally just care about the database, not the files behind it. You can copy or move those files and attach them to another instance if desired.

    2. Another option has been available for some time and appeared with SQL Server Express, intended to make SQL Server viable for single-user apps. You can created a service-based database in Visual Studio (VS) and that adds an MDF data file to your project. Instead of using the Initial Catalog attribute in your connection string to specify an attached database, you use the AttachDbFilename attribute to specify the path of the data file to be attached on demand. This means that only your application has access to that database and it only exists while your application is running. You can deploy the MDF file as part of your app and each installation then has its own local database.

  7. #7

    Thread Starter
    Member
    Join Date
    May 2020
    Posts
    37

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    Thank you my friends for your interaction with the topic
    But .........
    i installed SQL SERVER EXPRESS 2014
    Unfortunately, I cannot connect it to the database (Mdf file ) and SQL SERVER EXPRESS 2014 .. I do not know how that is .. I wish there was a way to make a connection between the database (Mdf file ) and the SQL SERVER EXPRESS 2014 with Visual Basic.net without downloading Mangment Studio

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

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    Where did the MDF file come from in the first place? Did you create it in VS or did you copy/detach it from an existing SQL Server instance? Do you want it to be permanently attached or attached on demand, as I described in my last post? Have you done any research on those two options? If the latter then you do that via the connection string, as I already described. If the former then you can use SQL Server's commandline tools but I would strongly recommend using SSMS if you know so little about SQL Server.

  9. #9

    Thread Starter
    Member
    Join Date
    May 2020
    Posts
    37

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    1- i created a Mdf file and LDF file on another pc. by Mangment Studio SQL SERVER
    2- ON MY PC. I install SQL SERVER Express
    3- By Attach Project ..Attempted to attach Mdf file to QL SERVER Express .. I was surprised that the following picture appearedName:  1.jpg
Views: 377
Size:  56.1 KB

  10. #10
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    You need to create a Backup of your database, and then Restore it to your new server, copying the MDF files and trying to attach it will not work.

    You create a Backup of your database by right clicking on the database in SQL SERVER, select Tasks, then select Back Up,

    Make sure your database is selected + backup type = Full

    In the Backup screen you may need to select a location for the backup (make a note of the location as thats where you will navigate to to get you backup file)

    then press OK
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  11. #11
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    Quote Originally Posted by vbxprogrammer View Post
    1- i created a Mdf file and LDF file on another pc. by Mangment Studio SQL SERVER
    2- ON MY PC. I install SQL SERVER Express
    3- By Attach Project ..Attempted to attach Mdf file to QL SERVER Express .. I was surprised that the following picture appearedName:  1.jpg
Views: 377
Size:  56.1 KB
    What does your connection string look like? Do NOT post a screenshot of it... it's text... copy it and paste it... it's possible that the connection string isn't correct.


    Quote Originally Posted by NeedSomeAnswers View Post
    You need to create a Backup of your database, and then Restore it to your new server, copying the MDF files and trying to attach it will not work.

    You create a Backup of your database by right clicking on the database in SQL SERVER, select Tasks, then select Back Up,

    Make sure your database is selected + backup type = Full

    In the Backup screen you may need to select a location for the backup (make a note of the location as thats where you will navigate to to get you backup file)

    then press OK
    It won't? Do pray tell why not? Because I've done this before numerous times and it does in fact work. If it didn't, then there would't be a point to the detach/attach database commands.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  12. #12
    Fanatic Member
    Join Date
    Jun 2019
    Posts
    557

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    Quote Originally Posted by techgnome View Post
    ...
    It won't? Do pray tell why not? Because I've done this before numerous times and it does in fact work. If it didn't, then there would't be a point to the detach/attach database commands.

    -tg
    True. Here is what ConnectionStrings.com says about attaching MDF file using System.Data.SqlClient:
    Attach a database file on connect to a local SQL Server Express instance using SqlConnection

    Connection string
    This .NET Framework Data Provider for SQL Server connection string can be used for connections to SQL Server 2019, SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 and SQL Server 2005.

    Code:
    Server=.\SQLExpress;AttachDbFilename=C:\MyFolder\MyDataFile.mdf;Database=dbname;
    Trusted_Connection=Yes;
    Why is the Database parameter needed? If the named database have already been attached, SQL Server does not reattach it. It uses the attached database as the default for the connection.

  13. #13
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data

    Thread moved to the 'Database Development' forum

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