[Solved] Data types in datatables

1 Answer 3 Views
Grid
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Rakhee asked on 04 Jun 2026, 01:15 PM

Hi

I am using telerik radgrid which has GridBoundColumns.

The query that is ran to populate the grid successfully returns the data.

However when the return values from the query is populated in a datatable it is blank and Im not sure why? Using C#

The column on the database is NUMBER datatype.

This is the grid on aspx page.

Any ideas on how to fix this please?

Thanks

Rakhee

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Jun 2026, 01:43 PM

Hi Rakhee,

Thank you for the details! Based on what you've shared, there are two likely causes for the blank cells.

Most likely cause — Oracle ODP.NET type mapping

Since the column is of type NUMBER, this suggests you may be using an Oracle database. When filling a DataTable via OracleDataAdapter (ODP.NET), NUMBER columns are stored as Oracle.ManagedDataAccess.Types.OracleDecimal — a proprietary Oracle struct — instead of a standard .NET decimal. RadGrid cannot render this type and displays blank cells.

Fix 1 — Use SafeMapping (recommended):

var adapter = new OracleDataAdapter(command);
adapter.SafeMapping.Add("BOOKEDTIME", typeof(decimal));
adapter.Fill(dataTable);

Fix 2 — Convert the column after filling:

dataTable.Columns.Add("BOOKEDTIME_FIXED", typeof(decimal));
foreach (DataRow row in dataTable.Rows)
    row["BOOKEDTIME_FIXED"] = OracleDecimal.ToDecimal((OracleDecimal)row["BOOKEDTIME"]);
dataTable.Columns.Remove("BOOKEDTIME");
dataTable.Columns["BOOKEDTIME_FIXED"].ColumnName = "BOOKEDTIME";

Secondary check — DataField casing

Note that DataTable column name lookup in ASP.NET is case-insensitive, so DataField="BookedTime" and DataField="BOOKEDTIME" both work, this is unlikely to be the cause, but worth verifying that the DataField value matches the actual column name returned by your query.

If the above does not solve the issue, could you confirm:

  • Which database driver are you using? (Oracle.ManagedDataAccess, System.Data.OracleClient, or something else?)
  • How are you filling the DataTable — OracleDataAdapter.Fill(), DataReader, or an ORM?

This will help us pinpoint the exact fix for your setup.

 

Regards,
Rumen
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
commented on 04 Jun 2026, 02:08 PM

Hi Rumen

Thank you that is is very informative.

I applied the second options as I am already looping through the datatable. But I am getting a cast error.

Tags
Grid
Asked by
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Rumen
Telerik team
Share this question
or