Search code examples
asp.netvisual-studiolinqdatacontext

DataContext not visible when choosing data source for LinqDataSource


I have a page on which I've thrown a LinqDataSource and a GridView. I've created a DataContext LINQ-to-SQL class called dcResidents.dbml. When I attempt to configure the LinqDataSource to utilize the dcResidents data context - it doesn't appear in the list of options...though under class view (tab in VS) it does appear. I do have several other working datacontexts - why is this one not being recognized by VS?


Solution

  • Okay, here is my work-around:

    1. Remove data connections and re-add for SQL servers.
    2. Reference DataContext in code-behind first, then try using drag-and-drop interface.