I’m using an SqlServerCe database and a dataset. There’s no problem to transfer data to database. There Are two double value columns in the database displaying values properly. When I fill DataGridview from database with these values, the double values apperaring as Int. Here’s the part of code if necessary.
if (rdb_FillData.Checked)
{
dbDataSet.AppDataDataTable dTable = new App1.dbDataSet.AppDataDataTable();
AppDataTableAdapter.Fill(dTable);
AppDataBindingSource.DataSource = dTable;
AppDataDataGridView.Refresh();
}
You cannot change the DataType after the Datatable is filled with data. However, you can clone the Data table, change the column type and load data from previous data table to the cloned table as shown below.
Sample code to change datatype of a column to Decimal