Announcement

Collapse
No announcement yet.

HS3 Save to database sqlite

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

    HS3 Save to database sqlite

    Hello,
    After several hours of Internet research, I wrote a script to back up data in a SQLite database.

    I have this error message:

    Compiling script C:\HomeSeer HS3\scripts\SaveDatabase.vb: Type 'System.Data.SQLite.SQLiteCommand' not define.
    Compiling script C:\HomeSeer HS3\scripts\SaveDatabase.vb: Type 'System.Data.SQLite.SQLiteConnection' not define.

    Compiling script C: \ HomeSeer HS3 \ scripts \ SaveDatabase.vb: The Namespace or type specified in the Imports 'System.Core' does not contain any public member or can not be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name does not use other aliases.

    I have System.Data.SQLite.dll from the BIN directory of HS3 and HS3 in the root


    My Script:
    Imports System.Data.SQLite
    Sub Main()
    Dim cons As New System.Data.SQLite.SQLiteConnection
    Dim cmd As New System.Data.SQLite.SQLiteCommand
    cons.ConnectionString = "Data Source=C:\Homeseer HS3\Data\Ecodevices\Ecodevices.sqlite"
    cons.Open()
    cmd = cons.CreateCommand()
    cmd.CommandText = "INSERT INTO CPT1 (DATE, BBRHCJB1) VALUES('Now','test')"
    cmd.CommandType = CommandType.Text
    cmd.ExecuteNonQuery()
    cmd.Dispose()
    cons.Close()
    End Sub
Working...
X