Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

MSSqlConnectionProvider.GetConnectionString2005WithCache(String, String, String, String) Method

Returns a connection string used to open a specified MS SQL database using provided login credentials and to enable the SqlDependency feature.

Namespace: DevExpress.Xpo.DB

Assembly: DevExpress.Xpo.v21.1.dll

NuGet Package: DevExpress.Xpo

Declaration

public static string GetConnectionString2005WithCache(
    string server,
    string userId,
    string password,
    string database
)

Parameters

Name Type Description
server String

A string that specifies the SQL server name.

userId String

A string that specifies a user name.

password String

A string that specifies a user password.

database String

A string that specifies the database name.

Returns

Type Description
String

A connection string.

Remarks

Use the GetConnectionString2005WithCache method to create a cached data store provider via the corresponding XpoDefault.GetConnectionProvider method call. A cached data store provider will comprise a Root element (MSSql2005SqlDependencyCacheRoot) and Node element (DataCacheNode) linked to it.

XpoDefault.DataLayer = new SimpleDataLayer(XpoDefault.GetConnectionProvider(   
    MSSqlConnectionProvider.GetConnectionString2005WithCache(   
    "(local)", "UserID", "Password", "XPOSqlServer2005CacheAndNotification"),   
    AutoCreateOption.DatabaseAndSchema)); 

If you want to create a cached data store provider comprising only a MSSql2005SqlDependencyCacheRoot element, use the MSSqlConnectionProvider.GetConnectionString2005CacheRoot method.

See Also