Click here to Skip to main content
14,636,175 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
I created an app in Visual Studio 2019 using VB.NET and I have a .dbo database on SQL Server 2014 Management Studio on my PC its working fine. The problem here is I want to send this app to a customer to import the database and run the program. Do I have to change the connection string on his computer or something else to run the program perfectly? Or the best way to avoid this is making the app .exe and send it to him

What I have tried:

i have tried to make it in .exe form but the error was that the database can not be found anywhere
Posted
Updated 22-Apr-20 7:02am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Your customer needs to install SQL Server 2014 if you did not distribute it with your application.
SQL Server is notoriously hard to package and distribute with your application, if your needs are simple you could use LiteDB which is just a single .dll file, see:
best-databases-for-a-small-net-application~litedb[^]

Another problem with SQL Server is that there are many versions and different ways to connect, which leads to a lot of confusion.
So discussing all this here is not a good idea, it would be better to read a book or maybe start here: how-to-open-a-sql-server-database-by-using-the-sql-server-net-data-pro[^]
how-to-create-a-sql-server-database-programmatically-by-using-ado-net[^]

Using an .mdf file is not a good idea, it is better to create an SQL script (e.g. from Sql Server Management Studio) and create the database from your application.
See: Execute CREATE TABLE from SQL script File in VB.net[^]

If you are using LocalDb this needs to be installed too, see: sql server - LocalDB deployment on client PC - Stack Overflow[^]

Also see: DBO or MDF whats the diffrence? | The ASP.NET Forums[^]
   
v7
Comments
Member 14810219 22-Apr-20 13:43pm
   
thank you for your response but lets assume that the client install the sql server 2014 and import the database...the program itself will be working perfectly or do i have to make some changes?
Member 14810219 22-Apr-20 13:45pm
   
and one last thing is it a problem with .dbo databases? because i also tried to make a new one .mdf and package it with the entire program...if i change the .dbo database to .mdf and package it in .exe will it run perfectly on the client pc?
OriginalGriff 22-Apr-20 14:13pm
   
No - it would require either changes to your app to access the MDF file directly, or the installation of SQL Server on the client network.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100