Is there a way in c# to directly create a SQLLOCALDB instance? At the moment, we use sqllocaldb.exe, but need to be able to do it without using the external executable.
Check and create a LocalDB instance To do that, locate SqllocalDB.exe and run the following command in a command prompt: You will see a list of available LocalDB instances on the server. This command creates an instance of LocalDB named DEVELOPMENT by using SQL Server 2017 binaries and starts the instance.
LocalDB is absolutely supported in production. From the performance point of view it is identical to SQL Server Express, as they share the same database engine. Now, for a site running in full IIS I would recommend using service-based instance of SQL Server Express.
An instance of SQL Server Express LocalDB is an instance created by a user for their use. Any user on the computer can create a database using an instance of LocalDB, store files under their user profile, and run the process under their credentials. By default, access to the instance of LocalDB is limited to its owner.
You don't need to buy SQL Server, you need to create a SQL instance in it to use it.
You could use the SQL LocalDB Wrapper library.
It wraps the native APIs exposed by SQL LocalDB in a .NET 4.0 assembly.
It is also now available via NuGet.
Disclaimer: I maintain this library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With