Click here to Skip to main content
15,886,815 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I face this error:
DataSet does not support System.Nullable<>.

my code is :

C#
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;

public partial class admin_adminreports : System.Web.UI.Page
{
    DataClassesDataContext db = new DataClassesDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            CrystalReportViewer1.Visible = true;

            var query = (from s in db.Books
                         join d in db.Bookings on s.bookid equals d.bookid
                         orderby s.bookid
                         select new
                        {
                            s.bookid,
                            s.Screen_id,
                            s.Movie_id,
                            s.Show_id,
                            s.Fare_id,
                            s.tickets,
                            s.total,
                            s.bookdate,
                            d.userid,
                            d.Seat_id
                        }).ToList();

            ReportDocument report = new ReportDocument();
            report.FileName = Server.MapPath("CrystalReport.rpt");
            report.SetDataSource(query);
            CrystalReportViewer1.ReportSource = report;
        }
    }
}


please help me to solve this error.
Posted
Updated 30-Mar-15 8:14am
v4
Comments
ZurdoDev 30-Mar-15 14:19pm    
Which line of code causes the error? Sounds like you may not be getting any data.
Patel Lalit 30-Mar-15 15:10pm    
report.SetDataSource(query);
ZurdoDev 30-Mar-15 15:11pm    
query is probably null then.
Patel Lalit 31-Mar-15 4:13am    
means i dont understand what do you mean..?please explain me or help me to correct the code..
ZurdoDev 31-Mar-15 7:31am    
I suggest you debug the code. That's your best option. I can't run your code so I don't know what is wrong but I am guessing that if you ran it and checked the value of your variable "query" it would be null.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900