Current filter:
                                You should refresh the page.
                                Support Center
                                1
                                  • I am using XpoDefault.GetDataLayer method to initialize the Data Access Layer in my application. How can I properly build a connection string for any supported database provider?

                                1 Solution

                                Creation Date Rating Importance Sort by
                                7

                                It is impossible to identify the database type by a connection string. So, XPO requires you to add an additional parameter into the connection string to specify the provider type. The parameter name is XpoProvider. So, the connection string will be like this: XpoProvider=Provider name;Connection string. You can obtain the provider name from a XpoProviderTypeString public constant. Each provider has this constant defined. Below is a list of values of the XpoProvider parameter for each existing database provider:
                                AccessConnectionProvider: MSAccess
                                XpoProvider=MSAccess;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;
                                DataSetDataStore: XmlDataSet
                                XpoProvider=XmlDataSet;Data Source=C:\mydatabase.xml;Read Only=false
                                InMemoryDataStore: InMemoryDataStore
                                XpoProvider=InMemoryDataStore;Data Source=C:\mydatabase.xml;Read Only=false
                                MSSqlConnectionProvider: MSSqlServer
                                XpoProvider=MSSqlServer;Data Source=(local);User ID=username;Password=password;Initial Catalog=database;Persist Security Info=true
                                AdvantageConnectionProvider: Advantage
                                XpoProvider=Advantage;Data Source=\\myserver\myvolume\mypat\mydd.add;ServerType=local;User ID=ASSSYS;TrimTrailingSpaces=true
                                AsaConnectionProvider: Asa
                                XpoProvider=Asa;Uid=MyUsername;PWD=MyPassword;DBF=c:\mydatabase.db;Persist Security Info=true
                                AseConnectionPrvider: Ase
                                XpoProvider=Ase;Port=5000;Data Source=MyAseServer;User ID=MyUserName;Password=MyPassword;Initial Catalog=MyDatabase;Persist Security Info=true
                                DB2ConnectionProvider: DB2
                                XpoProvider=DB2;Server=MyAddress:MyPortNumber;User ID=MyUserName;Password=MyPassword;Database=MyDatabase;Persist Security Info=true
                                FirebirdConnectionProvider: Firebird
                                XpoProvider=Firebird;DataSource=localhost;User=SYSDBA;Password=masterkey;Database=MyDatabase.fdb;ServerType=0;Charset=NONE
                                MSSqlCEConnectionProvider: MSSqlServerCE
                                XpoProvider=MSSqlServerCE;Data Source=MyDatabase.sdf;Password=MyPassword
                                MySqlConnectionProvider: MySql
                                XpoProvider=MySql;Server=MyServerAddress;User ID=MyUserName;Password=MyPassword;Database=MyDatabase;Persist Security Info= true;Charset=utf8
                                ODPConnectionProvider: ODP
                                XpoProvider=ODP;Data Source=TORCL;User ID=MyUserName;Password=MyPassword
                                ODPManagedConnectionProvider: ODPManaged
                                XpoProvider=ODPManaged;Data Source=TORCL;User ID=MyUserName;Password=MyPassword
                                OracleConnectionProvider: Oracle
                                XpoProvider=Oracle;Data Source=TORCL;User ID=MyUserName;Password=MyPassword
                                PervasiveSqlConnectionProvider: Pervasive
                                XpoProvider=Pervasive;Server=MyServerAddress;UID=MyUserName;PWD=MyPassword;ServerDSN=MyDatabase
                                PostgreSqlConnectionProvider: Postgres
                                XpoProvider=Postgres;Server=127.0.0.1;User ID=MyUserName;Password=MyPassword;Database=MyDatabase;Encoding=UNICODE
                                SQLiteConnectionProvider: SQLite
                                XpoProvider=SQLite;Data Source=filename
                                VistaDBConnectionProvider: VistaDB
                                XpoProvider=VistaDB;Data Source=C:\mydatabase.vdb4
                                VistaDB5ConnectionProvider: VistaDB5
                                XpoProvider=VistaDB5;Data Source=C:\mydatabase.vdb5

                                See Also:
                                How to connect XPO to a database other than SQL Server or Access
                                Database Engines Supported by XPO
                                The Connection String Reference
                                How to use MS SQL Server instead of MS Access as a persistent storage

                                Show all comments

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners