C# WPF DataGrid doesn't show decimal from SQLite 3 database
<p>I ran into an issue with C# WPF, where I want to show some SQLite data table in WPF DataGrid control. We store the price of a product as a NUMERIC (but also tried as REAL, but it does the very same), but in the datagrid control it is shown as integer, despite on the SQLite DB Browser it shows the proper decimal value. Here is the code with which we fill in the data into the DataGrid:</p>

<pre><code>ProductsDataGrid.ItemsSource = db.GetDataSet("*", "products").Tables[0].AsDataView();
</code></pre>

<p>and the GetDataSet method looks like this:</p>

<pre><code>public DataSet GetDataSet(string columns, string table, string trailingCommands = "")
{
    var sqlcmd = string.Format("select {0} from {1} {2}", columns, table, trailingCommands);
    Utility.Log.Info(sqlcmd);
    DataSet dataSet = new DataSet();
    SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter(sqlcmd, this.dbconn);
    dataAdapter.Fill(dataSet);

    return dataSet;
}
</code></pre>

<p>Short version:
The program shows decimal numbers as int in a datagrid from SQLite DB</p>