none
how to specify table schema (owner) when using tableadapters? RRS feed

  • Question

  • Hello,

    I'd like to connect to an sql server 2005 database using tableadapters.
    When I add a tableadapter to my dataset in my project, the tableadaptersConfiguration Wizard (in Visual Studio 2005) easily lets me create a Fill() and GetData() method to populate the dataset with the SQL data.

    => In the automatically created designer.cs file, I notice that the datable's owner is added to the sql commandstring.
    => However, the datatable schema (owner) (dbo, or something else) is different in development and production environment...

    For example:

    (in development)

    SELECT FirstName, LastName
    FROM dbo.Employees


    (in production environment)

    SELECT FirstName, LastName
    FROM HumanResources.Employees



    The tableadapter isn't able to fill the data in production, since the specified table schema (owner)in the designer file is the one from development.
    => How can I parameterize the table schema (owner)?
        So that the correct table schema (owner) is used in development environment as well as in production environment?

    Thanks a lot.
    Lieven.

    • Moved by jack 321 Monday, July 7, 2008 6:37 AM off topic
    Thursday, July 3, 2008 8:42 AM

All replies