Table entity vs. view entity: Correct Directory?

i'm using data entity to model my database tables. i have a few tables and a view. for some reason i can't access the actual table entities but i can access the view. (see the code snippets below). this is where it get's odd. on a default page in the main root of the site i can use the first datasource declaration (see snippet below), once again using the view entity from my data entity model but not the a table entity. i have created an Admin directory off of the main root and with in one of it's pages i try to use the same datasource declaration using the view and it doesn't work. so i have to use a different datasource declaration (see in the code) and it works just fine. i don't know what the difference is other than the location, and so i don't know how to make it work using the same datasource declaration as i used in the page in the main root.

so i know this is getting into a different question but i need to know how to get my datasource declaration (the first one in the code snippet) to 1.) work on the pages in the subdirectory and 2.) work with my table entities modeled in my data entity model as well as the view(s)
*---first datasource declaration that works in the main root---*
<asp:EntityDataSource ID="dsAthleteInfo" runat="server" ConnectionString="name=MBSCEntities"
        DefaultContainerName="MBSCEntities" EnableFlattening="False" EntitySetName="vw_athleteinfo">
    </asp:EntityDataSource>

*---2nd datasource declaration that works in both the main root
and in the subdirectory---*

        <asp:SqlDataSource ProviderName="MySql.Data.MySqlClient" ID="dsAthleteInfo" runat="server"
        ConnectionString="Server=localhost;Database=studytimetracker;User=root;Password=w7pswrd;"
        SelectCommand="SELECT * FROM utathleteinfo">
        <DeleteParameters>
            <asp:Parameter Name="EntryID" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="EntryID" Type="String" />
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="Website" Type="String" />
            <asp:Parameter Name="Message" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>

Open in new window

LVL 1
Michael SterlingWeb Applications DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RonCraig_101Commented:
When you say doesnt work are you getting an error of anykind ?
Michael SterlingWeb Applications DeveloperAuthor Commented:
sorry,...i get the following error. (See code snippet): when i use this:

<asp:EntityDataSource ID="dsAthleteInfo" runat="server" ConnectionString="name=MBSCEntities"
        DefaultContainerName="MBSCEntities" EnableFlattening="False" EntitySetName="utathleteinfo">
    </asp:EntityDataSource>

as my data source. this declaration contains an actual table entity as apposed to this:

<asp:EntityDataSource ID="dsAthleteInfo" runat="server" ConnectionString="name=MBSCEntities"
        DefaultContainerName="MBSCEntities" EnableFlattening="False" EntitySetName="vw_athleteinfo"> </asp:EntityDataSource>

which contains the view entity (see the "EntitySetName" property. and i was mistaken in my initial question, the 1st declaration above does not work in either the main root pages or the subdirectory's pages. the second declaration works (using the view) in both places.
Server Error in '/StudyTimeTracker' Application.
EntitySet 'utathleteinfo' that was specified in page markup does not exist on the Container.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: EntitySet 'utathleteinfo' that was specified in page markup does not exist on the Container.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: EntitySet 'utathleteinfo' that was specified in page markup does not exist on the Container.]
   System.Web.UI.WebControls.EntityDataSourceView.ValidateEntitySetName() +89651
   System.Web.UI.WebControls.EntityDataSource.ValidateUpdatableConditions() +875
   System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +166
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   System.Web.UI.WebControls.GridView.DataBind() +4
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
   System.Web.UI.Adapters.ControlAdapter.CreateChildControls() +15
   System.Web.UI.Control.EnsureChildControls() +154
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

Open in new window

RonCraig_101Commented:
well at first glance it looks like you may have some problems with your connectionstring. I'm guessing that the reason for this error (EntitySet 'utathleteinfo' that was specified in page markup does not exist on the Container.) is that the object is null. take a look at this and let me know if it helps .
http://www.c-sharpcorner.com/UploadFile/raj1979/EntityDataSource08112008131006PM/EntityDataSource.aspx 

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michael SterlingWeb Applications DeveloperAuthor Commented:
so i guess my real problem / question is, why does my datasource declaration, not recognize that the table is part of the main container? it does exist and is part of my database and it is defined in the code that defines the entities.
Michael SterlingWeb Applications DeveloperAuthor Commented:
this example walked me through the GUI set up which made me realize / remember that the entities are given there own name when declared. i simply change my EntitySetName to that name in my code (that i had manually written). in my mind i knew that there was a different name for the entities because i know i'd seen them in the code before but couldn't find them or recall it. thanks again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.