cancel
Showing results for 
Search instead for 
Did you mean: 

DataSet does not support System.Nullable<>

Former Member
0 Kudos

Hi everyone I am getting the above error in my report. I use Crystal Reports with Visual Studios 2010 (Crystal Reports for .Net Framework 4 not sure which version).

Anyway I have some fields which can have Null values. I handle them using nullable properties like Int32?

I handle strings in the Reader:

ImeZaduzioca = (string)((Reader["PREZIME"] == DBNull.Value) ? null : Reader["PREZIME"]),

Now this all works for the Visual Studios part but when it comes to reports it gives me the error.

I searched online and found that you could set in report options to change database NULLs to DEFAULTS but I still got the same error.

I also found that the problem is that it doesn't support nullable properties so I tried changing them (since I have a separate class for the report) to non nullable and in the reader changing it but then I get a DBNull error.

I also tried changing my code to not change into nulls but into some allowed values:

ImeZaduzioca = (string)((Reader["PREZIME"] == DBNull.Value) ? string.Empty : Reader["PREZIME"]),

Or

ImeZaduzioca = (string)((Reader["PREZIME"] == DBNull.Value) ? "" : Reader["PREZIME"]),

But no luck same error shows up every time.

I am hoping you guys could help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Does anyone have any idea how to solve this?

Former Member

Answers (0)