Current filter:
                                You should refresh the page.
                                  • Hi there,   I use a custom schema for my tables and I need to view the records in the dbo schema.   I update the model with the new table but when I run the application it creates a new table instead of looking at the DBO one.  SQL Profiler says it's looking for [newschema].tablename instead of [dbo].tablename.

                                    How do I modify the app so that it looks at dbo instead of newschema?

                                    [C#]
                                    private IDataStore CustomizeDataStore(IDataStore dataStore) { if (dataStore is MSSqlConnectionProvider) { ((MSSqlConnectionProvider)dataStore).ObjectsOwner = "newschema"; } return dataStore; }

                                    I've searched around in the documentation and support incidents but can't seem to find anything.   The closest I can find is querying between two databases.

                                    Thanks!

                                1 Solution

                                Creation Date Importance Sort by

                                Hello.

                                If some of your classes are mapped to tables in the default (dbo) schema while others are mapped to tables in other schemas, it is better to leave the ObjectsOwner field unchanged. Instead, specify the table schema along with the table name in the PersistentAttribute applied to a class as follows:

                                [C#]
                                [Persistent("MySchema.MyTable")] public class MyClass : XPLiteObject { ... }

                                See also:
                                How do I map persistent classes to another schema, e.g. other than the default "dbo" in MS SQL Server?