I am using SQLite (System.Data.SQLite for .NET v1.0.116.0) for an application and having trouble getting the DefaultValue property values for fields from the table schema of the SQLite database.
Here is the database structure of the Plants table from the "DB Browser for SQLite" program:
![Name: 2022-07-11_6-20-49.jpg
Views: 43
Size: 28.6 KB]()
The DEFAULT property values of the "Active", "PlantType", "Sunshine", and "Water" fields are configured.
When I query the database schema for the Plant table using the following code, the DefaultValue property values for these 4 fields are not shown.
The Immediate Window shows the following:
Why are the DefaultValue properties that are configured in the SQLite database not returned by the query?
Here is the database structure of the Plants table from the "DB Browser for SQLite" program:
The DEFAULT property values of the "Active", "PlantType", "Sunshine", and "Water" fields are configured.
When I query the database schema for the Plant table using the following code, the DefaultValue property values for these 4 fields are not shown.
Code:
Dim strSQL As String = "Select * FROM [" & cboTables.Text & "]"
Using cmd As New SQLite.SQLiteCommand(strSQL, con)
Using rdr As SQLite.SQLiteDataReader = cmd.ExecuteReader(CommandBehavior.KeyInfo)
tbl = rdr.GetSchemaTable
End Using
End Using
For Each row As DataRow In tbl.Rows
Debug.WriteLine("{0}, {1}", row("ColumnName"), row("DefaultValue"))
Next row
HTML Code:
RecID,
AddDate,
ModDate,
Active,
CommonName,
BotanicalName,
PlantType,
Sunshine,
Water,
Note,