Executing SQL Commands

To execute a SQL command, create a GFXDCommand from the GemFire XD connection and supply the text of a SQL command.

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

GFXDClientConnection connection = null;

try
{
    connection = new GFXDClientConnection(connectionStr);

    GFXDCommand command = connection.CreateCommand();
    command.CommandType = CommandType.Text;
    command.CommandText = "SELECT COUNT(*) FROM product";

    connection.Open();

    int prodCount = Convert.ToInt32(command.ExecuteScalar());    
}
catch (Exception e)
{
    ///
    /// Log or re-throw exception
    /// 
}
finally
{
    connection.Close();
}