SQLite in C#

Hi all,

how can i use SQLite in C#?
Or how do i have to add the sqlite.dll assmebly to the c# script component…so i can type.
Using System.Data.SQLite etc.?
In python it is already there…import sqlite3 but not in c#

any help is welcome

In C# grasshopper component right click on component then choose manage assemblies and add the dll.
Then in the script after the [using]… greyed add
Using sqlite.dll;

Thanks…but unfortunatly i have no idea which download is the right one.
https://www.sqlite.org/download.html
This one seems not to work.

What is the message in the balloon ?

Thanks for help

I wonder if you don’t better need the .NET


And type that
image
https://www.codeguru.com/csharp/.net/net_data/using-sqlite-in-a-c-application.html

Thanks,
i downloaded the nudget package and reference to these dll in the c# assambly manager and got system.data.sqlite.

it works as expected

Hi Flokart,

I’m looking for a C# component that inputs a connector string and a SQL request, and will output the resulting data.
Would you have that handy ?

Or @laurent_delrieu perhaps ?

Hi,
i have very buggy first component test implemented nothing solid and unfortunatly i will not develope it further at the moment and it will cost small money if its ready to release but i can share what i have already and also the visual studio files if you want develope it by yourselve.
It is compiled for rhino 6.

In the zip file is the grasshopper component file with there assamblys.
Extract all and put it in your component folder.
sqlite.zip (225.5 KB)

And here is a example file.
sqlite_vs_01.gh (12.3 KB)

I hope it works for you.

Thanks a bunch !
I’ll try that tomorrow.

I’m amazed at how simply this python component manages to process multiple SQL queries :

I’m even puzzled because it manages to work with a tree as an input when in fact the access is set to “Item”.
Changing this to “List” or “Tree” puts the component in error though…Strange.

The Item/List/Tree access option is only working if you are actually processing lists/trees inside your component. As of now, you are only using single items in the component(the “SQL” part) and do this for every item in the tree. Thats why it is replicating the tree structure 1:1.

OK, got it, thanks for the explanation !