Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


DataContext from dbml not shown in LinqDataSource connection

Posted on 2011-10-24
Medium Priority
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
  • 2
  • 2
LVL 96

Accepted Solution

Bob Learned earned 2000 total points
ID: 37024180
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

ID: 37024636
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
ID: 37028829
I don't have any experience with DNN, so I have no idea what effect that could have on your problem.

Author Comment

ID: 37050927
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
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…
Screencast - Getting to Know the Pipeline
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

564 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