Connecting to GemFire XD with the ADO.NET Driver

Use the GFXDClientConnection class to create a new connection to a GemFire XD cluster. You must specify a connection URL of the form "server=hostname:port".

For example:
string gfxdHost = "localhost";
int gfxdPort = 1527;
string connectionStr = string.Format(@"server={0}:{1}", gfxdHost, gfxdPort);

GFXDClientConnection connection = null;

try
{
    // Initialize and open connection
    connection = new GFXDClientConnection(connectionStr);
    connection.Open();

    ///
    /// Execute GemFire XD commands 
    ///
}
catch (Exception e)
{
    ///
    /// Log or re-throw exception
    /// 
}
finally
{
    connection.Close();
}
This creates a client connection to a GemFire XD server running on the local machine and listening on the default port 1527. You can configure the connection string as necessary to specify GemFire XD client connection properties. For example, the following string uses the secondary-locators connection property to try connecting to an alternate locator member if the first locator is not available:
string gfxdHost = "localhost";
int gfxdPort = 1527;
string secondHost = "locator2host";
int secondPort = 1528;
string connectionStr = string.Format(@"server={0}:{1};secondary-locators={2}:{3}", gfxdHost, gfxdPort, secondHost, secondPort);
[...]

See Configuration Properties for a description of client connection properties.

After you obtain a connection you can execute DDL and DML statements as necessary.