none
DataContext not showing in Website Data Sources Report Designer RRS feed

  • Question

  • My Linq is in one project and my web site is in another project and contains a reference to the Linq project.  I have used the Linq project with LinqDataSources and code witthout problems.  I am trying to create a .rdlc report and use a .dbml data context file created in the linq project.  I created the .dbml file.  Built the entire solution.  The new data context does not show in the Website Data Sources dialog in the report designer!  There are other .dbml data context files in the linq project that do show.  Why doesn't this new one?  I can create LinqDataSources and pull data for the new .dbml class so I know it works and is referenced properly.  Help is greatly appreciated!  I've also read many forum post where people have done this so I think it should work.....

    Wednesday, June 4, 2008 3:01 PM

Answers

  •  

    Sorry, this was a stored procedure that was exposed through the .dbml data context and not the data context itself.  It's good to know that I can do this though.
    Wednesday, June 4, 2008 4:51 PM

All replies

  •  

    Sorry, this was a stored procedure that was exposed through the .dbml data context and not the data context itself.  It's good to know that I can do this though.
    Wednesday, June 4, 2008 4:51 PM
  • You can expose the datasource in a .cs file in your data access layer.  See example below.   Youw will be able to select "getMyReport" in the report datasources in the rdlc file gui.  You use an ObjectDataSource in your web page rather than a LinqDataSource although the underlying connection is via linq.   The thing I have not been able to figure out is how to reassign the datasource in the code behind in order to be able to use with drillthrough reports.

    Thanks,   Kevin

    public IEnumerable sp_MyReportResult getMyReport(DateTime dtStart,DateTime dtEnd)

    {

     ReportingDataContext dc = new ReportingDataContext();

    var returnValue = dc.cp_MyReport(dtStart,dtEnd);

     return returnValue;

    }

    Wednesday, May 4, 2011 5:49 PM