Connect Grasshopper to Database

Hello,Sonngohong, I’m glad to know that rhino can connect with the database, but may you tell me what I can use to achieve it. With grasshopper or C# or something else , I’ll pretty appreciate if you could tell me, thank you very much!

@gaishicong - I’ve moved this to a new topic in the Grasshopper category.

Can you elaborate on what “the database” is?

thank you for your replay ,it’s the SQLserver

This question is still very broad, but yes, you probably can connect to a database if you’re willing to write some code. There may also be plugins for gh which make this easier.

Are you looking for a way to convert existing C# or VB code into grasshopper?

Thank you for help. I’m willing to write some C# code and I have written some with C# .Net Script component in grasshopper, but there are some error with the namesapce “using System.Data.SqlClient” , I can’t add referenced assemblies " System.Data.SqlClient.dll" .It will be better if there are plugins ,but i don’t find them

If you right-click on the C# component and select “Assembly” you can assign a dll to the component so the using clause can find what you are looking for.

and this dialog opens:

// Rolf

1 Like

thank you. But when I assign a “System.Data.SqlClient.dll” to the C# component, there will be an error,and I don’t konw why it is!

Presumably there’s a versioning conflict. The assembly you’re loading is probably from a newer version of the .NET framework than the script component is using.

Adding assembly references to scripts is quite a production, you may want to invest some effort into learning how to make components with Visual Studio. Also the debugging tools you’ll get in that case will be rather important when you run into problems.

1 Like

Thank you for your advice. But I don’t get that “make components with Visual Studio”, I would be very grateful if you can explain further or give an example,thank you again.