Announcement

Collapse
No announcement yet.

C# Library Assembly References / Using Directives

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    C# Library Assembly References / Using Directives

    Has anyone had any experience or luck with referencing an external library, assembly reference, or using directive within a C# script. I'm attempting a transact stream to an SQL Server instance on localhost and only need the methods from System.Data.SqlClient>System.Data.SqlClient.dll.

    I've tried every of my imaginable methods to reference the library, including:

    - Explicit //css_reference to the class, namespace, and directly to dll path.
    - Every imaginable using directive and all combinations thereof
    - Loading ScriptingReferences= in settings.ini (even though it indicates this is only for vb scripts)
    - Assembly loading with Assembly.LoadFrom(); (which needs another reference, also just outside my grasp.
    - Even tried BLDatabase which does a great job writing to an Access DB file after C# code translation but can't start an SQL Transact Stream or do what I need.
    - Every combination of everything above.

    Linq or Data import from mdb to mdf is not an option. I need a direct SqlConnection object from within the HS environment to solve my conundrum.

    There has to be something I'm missing or I will have to write an entire c# plug-in to get out of the environment to insert into or select from my local SQL Server instance.

    So, am I missing something simple or is C# support limited to System.Sh*t? If its limited to inherent classes, I can certainly empathize with that decision, but vb's not going to get this one done for me. HS3 is awesome software and my favorite hobby. I'm sure the disconnect is on my end, but this has driven me to dreaming in assembly. If my HomeSeer log asks me again if I'm missing a using directive my hobby may have to change!

    Thanks in advance for any help. Maybe knowing what magic code HS prepends to a C# script execution would help. I can't seem to find that anywhere and have had to wing modifications just passing parms from script triggers... Then again, that part may be proprietary and none of my business either.
Working...
X