DataContext from dbml not shown in LinqDataSource connection

Posted on 2011-10-24
Last Modified: 2012-05-12
Using Visual Studio 2010 & ASP.NET 3.5 w/ SQL Server 2008.

I've created a Test.dbml with local tables in it, and then created an aspx page

I then added a LinqDataSource control to it. When I try to configure LinqDataSource's "Configure Data Source" wizard however, and click the "Show only DataContext objects" checkbox, the "Choose your context object" listbox is EMPTY!

Any idea on why the data context from the DBML isn't showing up?

Note: In the code behind (using VB.NET here), I did following as a test, and the datacontext is found (i.e. is valid)
Dim dc As New TestDataContext
Question by:cdakz
    LVL 96

    Accepted Solution

    I haven't used LINQ-to-SQL with the LinqDataSource, so my first question would be, "Did you rebuild the solution before you tried that?".  Sometimes, tools use reflection to examine the assembly, and if it is not built, you won't get valid results.

    Author Comment

    These are some web pages that I'm adding into a DotNetNuke website. I didn't open them as a Web Application project, as they don't really need to be included in DNN's builds. So I'm adding them as plain old simple Website files (i.e. no build involved).

    I did a quick test previously to see if this would work, and it did (including the availablility of the data context).
    LVL 96

    Expert Comment

    by:Bob Learned
    I don't have any experience with DNN, so I have no idea what effect that could have on your problem.

    Author Comment

    I created a new local installation of this website and then opened in VS 2010, and this time it saw the Data Context. So I suspect that the previous suggeston about rebuilding the solution might have worked.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    how many extra RAM for SQL server is needed 22 26
    What does this mean? 6 25
    Starting to learn JAVA, 7 34
    SQL Server 2008 Error 7 32
    Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now