xpo-3243-examples-how-to-connect-xpo-to-a-database-other-than-ms-sql-or-ms-access.md
XPO supports a number of database engines, all of which are listed in Database Systems Supported by XPO, together with corresponding XPO data store adapters and database provider assemblies. The adapter assembly name contains the server name it supports. For example, DevExpress.Xpo.Advantage supports the Advantage database, DevExpress.Xpo.Ase supports Sybase, etc.
To make XPO use your database server, you should do the following:
Create a connection to your MySql database, as shown below:
static void Main() {
string conn = DevExpress.Xpo.DB.MySqlConnectionProvider.GetConnectionString(
"ServerName", "UserName", "Password", "DatabaseName");
XpoDefault.DataLayer = XpoDefault.GetDataLayer(conn, AutoCreateOption.DatabaseAndSchema);
Application.Run(new MainForm());
}
Shared Sub Main()
Dim conn As String = DevExpress.Xpo.DB.MySqlConnectionProvider.GetConnectionString( _
"ServerName", "UserName", "Password", "DatabaseName")
XpoDefault.DataLayer = XpoDefault.GetDataLayer(conn, AutoCreateOption.DatabaseAndSchema)
Application.Run(New MainForm())
End Sub
See Also