.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Embed a SQL Server Database in an AutoCAD DLL?

4 REPLIES 4
Reply
Message 1 of 5
emaguilera
410 Views, 4 Replies

How to Embed a SQL Server Database in an AutoCAD DLL?

Hello everyone,

I'm currently developing a plugin for AutoCAD using .NET, and I need to embed a SQL Server database within the DLL file of my AutoCAD application. My goal is to ensure that the database is seamlessly integrated and accessible when the DLL is loaded.

Any code examples or detailed steps would be greatly appreciated. Thank you in advance for your help!

Best regards
Emanuel.

Tags (1)
4 REPLIES 4
Message 2 of 5
norman.yuan
in reply to: emaguilera

You cannot "Embed" SQL Server database in your DLL. MS SQL Server itself is a quite big service application itself, which can host/serve/manage many databases, while you could install it (sat the Express version) on each computer where your Acad app runs, it usually runs on a server computer of your office's intranet, or even from a remote host in the cloud. Your app can only access the database via the SQL Server. Further more, with current technology trend, letting client side app (your CAD app) to have direct access might not be a good practice, and your IT department may even not allow such direct access. Instead, the data served from SQL Server (or any database server) would be wrapped with service and exposed to end apps, most likely via HTTP(s) services.

 

Anyway, if your app need to access the data hosted by SQL Server, you DO NOT embed SQL Server with your CAD app DLL (not possible!). You use database access API, ADO.NET, basically, such as System.Data.SqlClient (Microsoft.Data.SqlClient, if you do Acad2025) in conjunction of other classes in System.Data.Xxxxx namespaces, if you do have access to a Sql Server running somewhere in your network, or even in your computer (then all your users have to go to your computer to get data!). You may need to learn some basic about how to set up database, assign permission to access... which are the knowledges/skills of another profession of database server administrator.

 

You can search the net/youtube for ADO.NET tutorial - there are tons of it.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 5
daniel_cadext
in reply to: emaguilera

With C++/ARX you can embed SQLite, I would search for SQLite bindings that do not required a provider.

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Message 4 of 5
daniel_cadext
in reply to: emaguilera

Also, there’s SQLite for AutoLisp here.

https://www.theswamp.org/index.php?topic=28286.0

in a pinch you can communicate with it through the lisp engine

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Message 5 of 5
kdub_nz
in reply to: emaguilera

I use SQLite DB bundled with the DLL's that use it. Can easily read and update the DB without replacing the Assembly . . .  but if your data is static that may not matter.

 

Regards,

 


// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.
Sometimes the question is more important than the answer.

class keyThumper<T> : Lazy<T>;      another  Swamper

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report