MySQL - vb.net: error in naamruimte line 0

Forum over Homeseer scripts (DUTCH forum)

Moderators: TANE, Ruud

Post Reply
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

MySQL - vb.net: error in naamruimte line 0

Post by Rutger »

Ik probeer een .vb script te draaien om devicevalues in een MySQL database te zetten, maar met welk ander voorbeeld dan ook van internet, ik krijg altijd dezelfde foutmelding (laat staan dat er een connectie gemaakt wordt): "Script compile error: De instructie is niet geldig in een naamruimte.on line 0"
Welke variant van onderstaande namespace(s) ik ook gebruik, het maakt niet uit.
Imports MySql.Data.MySqlClient
en evt:
Imports System.Data

Ik gebruik Mysql connector 5.2.7 en heb ook "MySql.Data.dll" naar de HSPRO map gekopieerd.
Via php heb ik nergens problemen mee, zowel Xampp met sql en php als Homeseer draaien op dezelfde pc.

Het script statusCallBack.vb uit het topic domoticaforum.eu/viewtopic.php?f=47&amp ... sql#p62780 geeft exact dezelfde error, net zoals al die vele andere voorbeelden van internet, die in principe allen met dezelfde namespaces beginnen.

Wat zie ik over 't hoofd?
My home automation blog: https://rutg3r.com
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

Re: MySQL - vb.net: error in naamruimte line 0

Post by Rutger »

I still don't know how to fix this namespace error. I tackled the problem with a seperate php file, which retrieve via DCOM the necessary Homeseer data and write it into MySQL.
Via Task manager there is a recurring event that run the php file. Just like a cronjob.
My home automation blog: https://rutg3r.com
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: MySQL - vb.net: error in naamruimte line 0

Post by raymonvdm »

I think this issue has something to do with
http://www.rutg3r.nl/store-homeseer-dev ... nto-mysql/

Because i can`t seem to get it working like you placed it on you`re blog

I have placed MySql.Data.dll in c:\Program Files\HomeSeer HS3\ (extracted from http://dev.mysql.com/downloads/connector/net/1.0.html) but i also trief different versions

Code: Select all


dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlException' is not defined.
dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlDataReader' is not defined.
dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlDataAdapter' is not defined.
dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlConnection' is not defined.
dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlCommand' is not defined.
dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlConnection' is not defined.
dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Namespace or type specified in the Imports 'MySql.Data.MySqlClient' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
dec-16 15:03:10	 	Error	Compiling script MySQL_Devices.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

Re: MySQL - vb.net: error in naamruimte line 0

Post by Rutger »

I have to check the Mysql version tonight when Im at home. At the moment I dont have this above issue anymore.
My home automation blog: https://rutg3r.com
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: MySQL - vb.net: error in naamruimte line 0

Post by raymonvdm »

Rutger wrote:I have to check the Mysql version tonight when Im at home. At the moment I dont have this above issue anymore.
Please do, and also tell me where to place the file :cry:

I currently have "Product version 1.0.10.0"
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

Re: MySQL - vb.net: error in naamruimte line 0

Post by Rutger »

I'm running a XAMPP server, version 5.6.8-0 (not the lastest version).
MySQL version 5.6.24
Phpmyadmin version 4.3.11
Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8

I've a "MySql.Data.dll" (v6.9.5) in the root of the HS3 folder.
There are no other Mysql dll files in HS3.

In HS3\Config\Setting.ini, you have define the Mysql dll:
"ScriptingReferences=MySql.Data.MySqlClient;MySql.Data.dll"

Attached the dll file and another Mysql script to upload values into MySQL.
Attachments
MySql.Data.zip
(173.25 KiB) Downloaded 623 times
Last edited by Rutger on Fri Dec 16, 2016 11:48 pm, edited 1 time in total.
My home automation blog: https://rutg3r.com
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: MySQL - vb.net: error in naamruimte line 0

Post by raymonvdm »

No success so far :-(

"ScriptingReferences=MySql.Data.MySqlClient;MySql.Data.dll"
or
ScriptingReferences=MySql.Data.MySqlClient;MySql.Data.dll

makes no difference
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

Re: MySQL - vb.net: error in naamruimte line 0

Post by Rutger »

I struggled for a very long time to get the Mysql vs. vb.NET working. It's already a long time ago I managed to get it working. I thought it was related to the version of the Mysql.dll. I made a type in the version number in my previous post, it should be (and I changed it already to) 6.9.5, but I'm definitely not on ver 1.0*.
https://downloads.mysql.com/archives/c-net/
My home automation blog: https://rutg3r.com
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

Re: MySQL - vb.net: error in naamruimte line 0

Post by Rutger »

Oja, did you restart after made the changes in settings.ini?
My home automation blog: https://rutg3r.com
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: MySQL - vb.net: error in naamruimte line 0

Post by raymonvdm »

Rutger wrote:Oja, did you restart after made the changes in settings.ini?
Jup :-) Still no go :shock:

Code: Select all


ec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlException' is not defined.
dec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlDataReader' is not defined.
dec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlDataAdapter' is not defined.
dec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlConnection' is not defined.
dec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlCommand' is not defined.
dec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Type 'MySqlConnection' is not defined.
dec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Namespace or type specified in the Imports 'MySql.Data.MySqlClient' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
dec-16 23:09:07	 	Error	Compiling script MySQL_Devices.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

I used your dll so it should be working

Note: i`m running windows 10
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
Rutger
Member
Member
Posts: 339
Joined: Wed May 19, 2010 8:48 pm
Location: Netherlands

Re: MySQL - vb.net: error in naamruimte line 0

Post by Rutger »

My HS3 is running on W8, but that should not be the issue I guess. what are you compiling? That are not normal HS log entries, right? is it for a plugin?
My home automation blog: https://rutg3r.com
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: MySQL - vb.net: error in naamruimte line 0

Post by raymonvdm »

Yeah it is working :-)

The scripting reference was placed in the last line of settings.ini and therefore it was not included in the settings.

Thanks for the support!!

Now let`s find out how to get the AUTO_INCREMENT in the mysql table :D

Code: Select all

ALTER TABLE devices MODIFY COLUMN id INT auto_increment
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
Post Reply

Return to “Homeseer Scripts Forum”