-
Jul 16th, 2020, 03:15 PM
#1
Thread Starter
Member
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
-
Jul 16th, 2020, 03:29 PM
#2
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
-
Jul 16th, 2020, 03:40 PM
#3
Thread Starter
Member
Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data
Originally Posted by techgnome
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. ?
-
Jul 16th, 2020, 03:46 PM
#4
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
-
Jul 16th, 2020, 03:52 PM
#5
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
-
Jul 16th, 2020, 08:35 PM
#6
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.
-
Jul 16th, 2020, 10:08 PM
#7
Thread Starter
Member
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
-
Jul 16th, 2020, 10:19 PM
#8
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.
-
Jul 16th, 2020, 10:24 PM
#9
Thread Starter
Member
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 appeared
-
Jul 17th, 2020, 03:49 AM
#10
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
-
Jul 17th, 2020, 06:20 AM
#11
Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data
Originally Posted by vbxprogrammer
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 appeared
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.
Originally Posted by NeedSomeAnswers
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
-
Jul 17th, 2020, 06:26 AM
#12
Re: How Run SQL Server database 2014 on the user's PC.without Installing Server data
Originally Posted by techgnome
...
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.
-
Jul 17th, 2020, 07:05 AM
#13
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|