הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Question
Thursday, June 7, 2018 6:28 AM
I am trying to create a .exe application using Visual basic project. I have an SQL database that i created using my SQL server 2014, so i am not using a local database because it is not stable thus i prefer using the SQL server database. The problem is that i do not know how to merge the project with the database so that i can create the .exe setup for my project. i want the .exe setup file for my project to automatically have the database in the program files after installing it in another computer and the computer doesn't need to have the SQL server installed so that the database can work. I want it to be a standalone application with everything in it, please help!
msdn account collohdicey
All replies (10)
Thursday, June 7, 2018 7:29 AM
You can create a Visual Studio Setup Project to create a setup which will install your application and database. You will have to write code in custom action to create database from setup
https://techbrij.com/install-sql-server-database-with-visual-studio-setup
If you are using Visual Studio 2017 then you can install following extension.
Note: You have to install SQL Server first before trying to create database
Gaurav Khanna | Microsoft MVP | Microsoft Community Contributor
Thursday, June 7, 2018 7:38 AM | 1 vote
You cannot. SQL server is a product of Microsoft. If you deliver it in your way (for what Microsoft has not authorized you), you doing a fraud in almost every country in the world (I don't know if there is one where that is not the case).
Microsoft has to solve your problem created Azure. Yes you have to pay for it. But Microsoft gives Visual Studio as freeware to earn money by this.
https://azure.microsoft.com/en-us/pricing/details/sql-database/managed/
Success
Cor
Thursday, June 7, 2018 8:16 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
Thursday, June 7, 2018 9:14 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
So there is no way i can have a standalone inbuilt SQL server database without installing SQL server first in the computer?
msdn account collohdicey
Thursday, June 7, 2018 9:45 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
So there is no way i can have a standalone inbuilt SQL server database without installing SQL server first in the computer?
msdn account collohdicey
That is correct, at the very least you need to have SQLEXPRESS edition installed for SQL-Server. As you ask for server based, SQLEXPRESS is a local server based version of SQL-Server.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
VB Forums - moderator
Thursday, June 7, 2018 11:11 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
So there is no way i can have a standalone inbuilt SQL server database without installing SQL server first in the computer?
msdn account collohdicey
Unlike Jet is SQL Express a real server. Jet (MS Access) is a file.
AFAIK it can also be used as online server for small databases if you install it like that. That was the case since it was named MSDE 2000 server (I guess only Paul remembers that one and maybe Reed). That could for me only be used with the Dutch Microsoft instruction. The English instruction was wrong.
Success
Cor
Thursday, June 7, 2018 11:47 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
So there is no way i can have a standalone inbuilt SQL server database without installing SQL server first in the computer?
msdn account collohdicey
SQL Server is a poor choice for use as an embedded database. You can still use SQL CE, although it may be removed from future versions of .NET or a third-party database such as SQLite, where you can deploy the database engine assemblies with your app.
Paul ~~~~ Microsoft MVP (Visual Basic)
Friday, June 8, 2018 1:09 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
So there is no way i can have a standalone inbuilt SQL server database without installing SQL server first in the computer?
msdn account collohdicey
Yes you can do it if you install LocalDB on the machine and install the standalone MDF file to c:\users\username where LocalDB excepts to find the MDF file.
<copied>
LocalDB installation copies a minimal set of files necessary to start the SQL Server Database Engine. Once LocalDB is installed, you can initiate a connection using a special connection string. When connecting, the necessary SQL Server infrastructure is automatically created and started, enabling the application to use the database without complex configuration tasks. Developer Tools can provide developers with a SQL Server Database Engine that lets them write and test Transact-SQL code without having to manage a full server instance of SQL Server.
<end>
Localdb can be installed through its msi file that you could install through an install package along with placing the MDF file that has been detached from the database engine and placing the MDF file in the spot where Localdb expects it, or you can use the Localdb connectionstring and point to the MDF file path.
Windows Vieta and O/S(s) after Vista, you cannot place the MDF file in C:\program files, since that is a protected area.
You need to get the Localdb installed based on the version of MS SQL Server Express you have developed against, like 2015 as opposed to 2017.
Friday, June 8, 2018 8:26 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
So there is no way i can have a standalone inbuilt SQL server database without installing SQL server first in the computer?
msdn account collohdicey
Yes you can do it if you install LocalDB on the machine and install the standalone MDF file to c:\users\username where LocalDB excepts to find the MDF file.
<copied>
LocalDB installation copies a minimal set of files necessary to start the SQL Server Database Engine. Once LocalDB is installed, you can initiate a connection using a special connection string. When connecting, the necessary SQL Server infrastructure is automatically created and started, enabling the application to use the database without complex configuration tasks. Developer Tools can provide developers with a SQL Server Database Engine that lets them write and test Transact-SQL code without having to manage a full server instance of SQL Server.
<end>
Localdb can be installed through its msi file that you could install through an install package along with placing the MDF file that has been detached from the database engine and placing the MDF file in the spot where Localdb expects it, or you can use the Localdb connectionstring and point to the MDF file path.
Windows Vieta and O/S(s) after Vista, you cannot place the MDF file in C:\program files, since that is a protected area.
You need to get the Localdb installed based on the version of MS SQL Server Express you have developed against, like 2015 as opposed to 2017.
But you still have to install SQL Server Database Engine .
Friday, June 8, 2018 9:15 AM
Use SQL Express, it's free. But you still have to install the Database Engine in order for you to access the database.
So there is no way i can have a standalone inbuilt SQL server database without installing SQL server first in the computer?
msdn account collohdicey
Yes you can do it if you install LocalDB on the machine and install the standalone MDF file to c:\users\username where LocalDB excepts to find the MDF file.
<copied>
LocalDB installation copies a minimal set of files necessary to start the SQL Server Database Engine. Once LocalDB is installed, you can initiate a connection using a special connection string. When connecting, the necessary SQL Server infrastructure is automatically created and started, enabling the application to use the database without complex configuration tasks. Developer Tools can provide developers with a SQL Server Database Engine that lets them write and test Transact-SQL code without having to manage a full server instance of SQL Server.
<end>
Localdb can be installed through its msi file that you could install through an install package along with placing the MDF file that has been detached from the database engine and placing the MDF file in the spot where Localdb expects it, or you can use the Localdb connectionstring and point to the MDF file path.
Windows Vieta and O/S(s) after Vista, you cannot place the MDF file in C:\program files, since that is a protected area.
You need to get the Localdb installed based on the version of MS SQL Server Express you have developed against, like 2015 as opposed to 2017.
But you still have to install SQL Server Database Engine .
So? One can do it through the MSI file installing localDB only, which is not the full database engine, anyway.
Myself, I would have no problems in installing localdb using the msi file with using an install package, and then having the install package take the exe and DLL(s) installing them in C:\program files and then take the MDF and LDF files and installing them where they need to be either.
You know people always have a tired and negative excuse on just about everything no matter what it is.