Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5848677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:53:34+00:00 2026-05-22T12:53:34+00:00

I was following the Contoso University tutorial on the asp.net website and it all

  • 0

I was following the Contoso University tutorial on the asp.net website and it all works well. My next step was to replicate some of the things on my own new website. I have added an EntityDataSource that works:

    <asp:EntityDataSource ID="ProductTypeEntityDataSource" runat="server" 
        ConnectionString="name=MyWebsite2011Entities" 
        DefaultContainerName="MyWebsite2011Entities" EnableFlattening="False" 
        EntitySetName="product_type">

And according to the tutorial it is a good idea to replace the ConnectionString and DefaultContainerName with a ContextTypeName.

“In the markup for the EntityDataSource control, remove the ConnectionString and DefaultContainerName attributes and replace them with a ContextTypeName=”ContosoUniversity.DAL.SchoolEntities” attribute. This is a change you should make every time you create an EntityDataSource control, unless you need to use a connection that is different from the one that’s hard-coded in the object context class.”

That worked fine for me in the tutorial where they had a:

    <asp:EntityDataSource ID="StudentsEntityDataSource" runat="server"
        ContextTypeName="ContosoUniversity.DAL.SchoolEntities"
        EnableFlattening="False"
        EntitySetName="People"
        EnableDelete="True" EnableUpdate="True">
    </asp:EntityDataSource>

The difference for me (besides the project name) is that my entity model is not placed in a DAL folder. Instead I accepted the Visual Web Developer’s default folder name recommendation. I believe it was “App_Code”. But the ContextTypeName=”MyWebsite2011.App_Code.MyWebsite2011Entities” doesn’t work. When I start the browser, it complains that the type MyWebsite2011.App_Code.MyWebsite2011Entities could not be read.

    <asp:EntityDataSource ID="ProductTypeEntityDataSource" runat="server" 
        ContextTypeName="MyWebsite2011.App_Code.MyWebsite2011Entities"
        EnableFlattening="False" EntitySetName="product_type">

How do I find the correct ContextTypeName to put in? As I said, the ConnectionString and DefaultContainerName worked, so I guess the MyWebsite2011Entities is ok. Any hints would be appreciated because I don’t know the naming convention or what to look for.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:53:35+00:00Added an answer on May 22, 2026 at 12:53 pm

    Open up the .cs file in which the Context is declared, and look at text immediately after the namespace declaration. That’s your class’s namespace. Your ContextTypeName should be <namespace>.<classname> (without the <> brackets, of course.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been following the Microsoft Contoso MVC3 University Tutorial located here I have
Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
Following the TkDocs Tutorial (http://www.tkdocs.com/tutorial/widgets.html#checkbutton) I am trying to set up a check box,
Following are the two approaches: constructor with all the class properties Pros: I have
Following on from How do you test the performance of a website? : What
Following this tutorial http://msdn.microsoft.com/en-us/vstudio/hh543922.aspx , I'm trying to use the ReplaceNode method that should
Following on from this question , I need to set some memory values to
Following on from my last question : I've written some code to upgrade a
Following my previous question, in which I wanted to dump all the variables in
Following is the code I have so far: All the imports are correct. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.