Download G120 SoM User Manual
Transcript
GHI Electronics,LLC
G120 SoM User Manual
The Libraries
myDatabase.ExecuteNonQuery("INSERT INTO Temperature (Room, Time, Value)"+
" VALUES ('bed room', 060701, 7200)");
// Process SQL query and save returned records in SQLiteDataTable
ResultSet result = myDatabase.ExecuteQuery("SELECT * FROM Temperature");
// Get a copy of columns orign names example
String[] origin_names = result.ColumnNames;
// Get a copy of table data example
ArrayList tabledata = result.Data;
String fields = "Fields: ";
for (int i = 0; i < result.RowCount; i++)
{
fields += result.ColumnNames[i] + " |";
}
Debug.Print(fields);
object obj;
String row = "";
for (int j = 0; j < result.RowCount; j++)
{
row = j.ToString() + " ";
for (int i = 0; i < result.ColumnCount; i++)
{
obj = result[j, i];
if (obj == null)
row += "N/A";
else
row += obj.ToString();
row += " |";
}
Debug.Print(row);
}
}
myDatabase.Dispose();
}
This requires the GHI.SQLite assembly.
Rev. 0.04
Page 62 of 67
www.GHIElectronics.com