Entity data model

Discussion in 'ASP .Net' started by Seema, May 12, 2009.

  1. Seema

    Seema Guest

    I put a page in a web applicationproject, added an ado.net entity model and
    told it to generate the model from existing database, went back to my empty
    page and put a GridView on it.I right clicked on the GridView and went to
    show smart tag. I went to choose a datasource combo box and pressed downarrow
    once (to create a new datasource). I chose entity and left the default name
    EntityDataSource1 andthen pressed ok. I then got this error:

    The entity model meta data specified in the connection string could not be
    loaded. unable to load the specified meta data resourses
    Seema, May 12, 2009
    #1
    1. Advertising

  2. Seema

    Mr. Arnold Guest

    "Seema" <> wrote in message
    news:...
    >I put a page in a web applicationproject, added an ado.net entity model and
    > told it to generate the model from existing database, went back to my
    > empty
    > page and put a GridView on it.I right clicked on the GridView and went to
    > show smart tag. I went to choose a datasource combo box and pressed
    > downarrow
    > once (to create a new datasource). I chose entity and left the default
    > name
    > EntityDataSource1 andthen pressed ok. I then got this error:
    >
    > The entity model meta data specified in the connection string could not be
    > loaded. unable to load the specified meta data resourses


    Well, did this Smart tag make the connection string? How do you know it's
    actually pointing to the Model? The ADO.NET EF makes its own connection
    string sitting in the app.config when you compiled the project that contains
    the Model, if you told the EF Model creation wizard to make the connection
    string during Model creation.

    The connection string that the EF model creates must be copied to the
    Web.config. And somehow this Smart Tag thing must point to the connection
    string that the EF made I suspect.




    __________ Information from ESET NOD32 Antivirus, version of virus signature database 4068 (20090512) __________

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
    Mr. Arnold, May 13, 2009
    #2
    1. Advertising

  3. Seema

    Mr. Arnold Guest

    "Seema" <> wrote in message
    news:...

    <snipped>

    This is what I would do to load a datagrid from an Entity off of the EF
    Model.

    1) I would copy the connection string that the EF Model creation wizard
    created to the Web.config. That connection string gives you the reference to
    the Model and its mata data.

    2) I would do this.

    using(var dbconn = new EnityConnection())
    {
    datagrid.datasource = from a in dbconn.Entity select a; // loads all
    the records
    }

    The Entity will be whatever table you're trying to load.

    You'll need to use System.Linq, and you'll need System.Data.EntityClient.

    If you're using VB.Net, it's still the same thing.


    __________ Information from ESET NOD32 Antivirus, version of virus signature database 4068 (20090512) __________

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
    Mr. Arnold, May 13, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,615
    Jukka K. Korpela
    Feb 24, 2007
  2. Bobby Edward

    How add data to Entity Data Model via code?

    Bobby Edward, Sep 23, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    389
    Bobby Edward
    Sep 23, 2008
  3. markla
    Replies:
    1
    Views:
    540
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    2,698
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,190
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page