Sub loadSettings(byval DBPath as string)
Dim Names() As String
Dim Values() As String
Dim conn As SQLiteConnection = New SQLiteConnection("Data Source=" & DBPath)
conn.SetPassword(dbPassword)
conn.Open()
'conn.ChangePassword(vbNullString)
sSQL = "Select Name,Value From settings"
Dim cmd As SQLiteCommand = New SQLiteCommand(conn)
cmd.CommandText = sSQL
Dim reader As SQLiteDataReader = cmd.ExecuteReader()
Dim i As Integer = 0
If reader.VisibleFieldCount > 0 Then
dicSettings.Clear()
End If
Do While (reader.Read())
ReDim Preserve Names(i)
ReDim Preserve Values(i)
Names(i) = reader.Item("name").ToString
Values(i) = reader.Item("value").ToString
dicSettings.Add(Names(i), Values(i))
Loop
reader.Close()
conn.Close()
'// apply the settings //
End Sub