Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

how to use a C#node to visit MySql database and operate it

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
zhaohuifu

how to use a C#node to visit MySql database and operate it

Post by zhaohuifu » 31 Jul 2013, 07:09

hi,
I want to use a C# script node to do some operation with MySql database in ventuz ,
I found that "if I want to connect to MySql database with C#,I need to download a MySQL-connector-net-6.0.4-noinstall.rar,put it in the folder"project\bin",and import it in VS",(I do some test in VS).
if I do it in ventuz by C# script node,firstly I need to solve the problem that "import the mysql package ".
in the user manual, it said that "only .Net Assemblies which are registered in the Global Assembly Cache(GAC) can be added to the GAC Assemblies list". I wonder that whether the MySql.Data.dll I need is the kind of the ".Net Assemblies".And how to registered in the Global Assembly Cache.
now ,this two problem make me confused .
have anyone met this problem
just help me .


best regard!.

SamTheSwede
Posts: 91
Joined: 18 Jan 2012, 11:31

Re: how to use a C#node to visit MySql database and operate

Post by SamTheSwede » 31 Jul 2013, 20:27

I don't know much about MySql, but if you have a dll that you reference in VS, just add that dll to the GAC using gacview.exe (just google it, you'll find it) and you will be able to use it in your c# scripts in Ventuz as well.

// Sam

zhaohuifu

Re: how to use a C#node to visit MySql database and operate

Post by zhaohuifu » 01 Aug 2013, 09:53

thanks for you help.
now ,another question :
in the script ,I declare a array whose type is int, int [] wage. in the out property of the C# node;
I want to do this:
int i = 0;
for(i=0;i<10;i++)
wage =i;
when compile,the error is :the property or indexer "ScriptBase.wage"cannot be applied in the context,for that it lack the getter method.
I just describe the error in my way .

while when I declare a int variable ,the error do not exist;
so ,why ?
I think the variables we declare,their property both are "protected",I don't know the difference between the int a and int [] a.

can you give me some tip or help.

Christian Krix Schmidt
Posts: 290
Joined: 18 Jan 2012, 11:36
Location: Dubai, United Arab Emirates
Contact:

Re: how to use a C#node to visit MySql database and operate

Post by Christian Krix Schmidt » 01 Aug 2013, 10:33

You cannot assign values to individual indices of an output property array in the script. You have to use a temporary array in the script first. Make all changes to that array inside the script and then afterwards assign this full array to the output property array.

serourian
Posts: 54
Joined: 30 Jun 2015, 12:06
Location: Lebanon
Contact:

Re: how to use a C#node to visit MySql database and operate

Post by serourian » 17 Dec 2015, 13:29

Please can anybody post a small example. thank u.

Post Reply