DataSet does not support System.Nullable<>.

Ehab Ahmed krer 0 Reputation points
2023-05-09T09:23:12.5333333+00:00

I've this problem with my project :

asp page :

var reportParam = (dynamic)HttpContext.Current.Session["ReportParam"];
            ReportDocument rd = new ReportDocument();
            //string path = Server.MapPath("~") + "Report//Rpt//" + reportParam.RptFileName;
            string path6 = System.Web.Hosting.HostingEnvironment.MapPath("//Reports//" + reportParam.RptFileName);

            var dataSource = reportParam.DataSource;
            rd.Load(path6);
            rd.SetDataSource(dataSource);
            CrystalReportViewer1.ReportSource = rd;
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,282 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,291 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,846 Reputation points
    2023-05-09T16:04:49.37+00:00

    the error is pretty clear. the DataSet class does not support column types of Nullable<T>. in your case System.DateTime?

    In a DataSet when defining a column you use the actual type and set a property whether the column is nullable. When null, DbNull is returned for the column value.

    You appear to be using a library that builds a DataSet based on POCO object types, but this library does not support Nullable<T> or it would unwrap the type and set nullable when creating the column in the DataSet.

    basically your database adapter does not support nullable value types.

    0 comments No comments