or
class DealerDataSource{ public IEnumerable<CalDealer> GetDealerInfo() { DAdbDataContext xxx = new DAdbDataContext(); // Dealer deal = db.Dealers.First(d => d.DealerId == 2); CalDealer cd = new CalDealer(); cd.Title = "Test"; yield return cd; }}public class CalDealer{ public string Title { get; set; }}
When I add the data context and go to preview the report it gives the error of
"object reference not set to an instance of an object".
It compiles OK -
If I take out DAdbDataContext xxx = new DAdbDataContext(); the report previews fine.
I know the data context is good as I'm using it in the code behind of a page.
Thanks!!
Ron
public static SqlDataSource ChangeConnectionString(object reportItem, int zoneNo)
{
dataSource.SelectCommand = ...the query with my parameter