Hi,
I m' lately trying to set up a SQL Server Compact Edition connection to my AutoCAD plugin. My goal is to have one db object that i will deploy with my plugin, so that i do not have to install MS SQL Server on every machine i want to deploy to.
My current setup is a Code first ADO.net with Entity Framework. Initially I was trying to do the following:Code - C#: [Select]
public MyDbContext() : base("name=MyContextString") { }
This code above gave me an error that the connection string does not exist in the App.config file.
I found a post that says that since I m developing a plugin. Acad.exe reads from Acad.exe.config and not my App.Config.
A solution would be to alter the acad.exe.config, but i was hoping for a solution where i could set my connection string with provider name from code.
Does anyone have a working example of a code based database configuration for a SQL Compact Edition database?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="MyDBName" value="Database Name" />
<add key="MyDBFileName" value="C:\MyData\MyDBFile.mdb" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>