Calling .NET libs from Delphi?

Calling .NET libs from Delphi?

Basically, I’d like to call sql generators from .NET System.Data.SqlClient, like it is done here:

http://scriptdb.codeplex.com/SourceControl/latest#ScriptDB/DatabaseScripter.cs

How much bending over backwards is required to to do this?

#sql  

13 thoughts on “Calling .NET libs from Delphi?


  1. If you need to do this from the IDE, it’s already a CLR host. There used to be some meager documentation on the interfaces they expose for assembly extension writers (more or less mirrors the interfaces exposed for native extensions) but I’m sure one of the many IL “reflector” tools out there would be more thorough.

    Like


  2. Lars Fosdal I’ve wrote something simple using RTTI, basically it creates the SQL dynamically and executes on connection, works noicely with pg and sqlite — can’t share code ): — but this requires published properties and attributes on fields and “table” object, however, it can switch db type and see “new tables” and create them all in a few lines of code.


    need a light install? use sqlite, need a hardcore install? install pg, run the app => database and default records created (:

    Like


  3. CrossTalk comes with an installer and the eval is really simple to try out. The import utility can show you before “importing” what types it can not handle. If the .net stuff is too convoluted (unmanaged EWS for an example) i usually write the bulk code in VS Express and put some simple interfacing methods that i import and call from Delphi.

    Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.