Previous Topic

Next Topic

Populate the Region DataSet

Populate the DataSet with the ingresDataAdapter2.Fill(DataSet dataSet) method:

private void LoadRegion(int direction, String nation,

    System.Data.DataSet placeDataSet)

{

    IngresParameter country = new

        Ingres.Client.IngresParameter("ap_ccode", IngresType.NChar);

    country.Value = nation;

    placeDataSet.Clear();

 

    ingresDataAdapter2.SelectCommand.Parameters.Clear();

    ingresDataAdapter2.SelectCommand.Connection.Open();

    ingresDataAdapter2.SelectCommand.Prepare();

    switch (direction)

    {

        case DEPART:

            departing.country = country.Value.ToString();

            break;

        case ARRIVE:

            arriving.country = country.Value.ToString();

            break;

    }

    ingresDataAdapter2.SelectCommand.Parameters.Add(country);

    ingresDataAdapter2.Fill(placeDataSet);

    ingresDataAdapter2.SelectCommand.Connection.Close();

}


© 2006 Ingres Corporation. All rights reserved.