Local Database for winform Application

hello all,

I am not sure where I should post this but hope it finds it way to some help :).

I created a form application in VS 2019 C#. I added a service base database (MDF) file for the application to store and read some information…

this all works great on my development laptop but I get an error when running it on another computer that does not have SQL server or express installed.

Is this a requirement to have SQL server or express installed to use this? I am trying to use a DB that will not require the client to install anything in order to use the application.

any help would be great.



Maybe try https://www.sqlite.org/index.html

thank you kindly sir…that was the route to go in this case :slight_smile:

I face this about 4 years ago. It involves including LocalDb as part of the project which is what s being used in your development machine. I found some way around the issue but I dont recall. It was twisted. It SqlLite can be built into the solution you are far better off.

If you are targeting for SQL Server or Express, it has to be installed. But if you do not want to g owih installation, then please give a try to sqlite

Create a local database using Microsoft SQL Server

  1. Start and search for Microsoft SQL Server.

  2. To create a local database, you first need a server

  3. You are now connected to a server from which you can create a database. …

  4. Clicking New Database will display a window

  5. A new Object Explorer may now appear in the Database menu.


.NET Foundation Website | Blog | Projects | Code of Conduct