IBM® Informix® Client Software Development Kit, Version 4.10

Retrieve data into a DataSet

You can use an IfxDataAdapter object to retrieve database information into a System.Data.DataSet object for further processing.

The following example creates a System.Data.DataSet and populates it with the first and last names from the customer table. Then, to show that it is populated, it outputs the System.Data.DataSet to the console in the form of XML.

For the details about the IfxDataAdapter object, see IfxDataAdapter class. For more information about data sets see your .NET or ADO documentation.

    // Open a connection
    IfxConnection conn = 
        new IfxConnection(
        + "User ID=mylogin;password=mypassword"

    IfxDataAdapter da = new IfxDataAdapter(
        "SELECT fname, lname FROM customer",
        conn );
    System.Data.DataSet ds = new System.Data.DataSet("Names");

    //Fill the DataSet

    //The DataSet is ready to use.
    //This example outputs the DataSet to the Console as XML
    //just to show that it is populated.
    Console.ReadLine(); //Wait for a Return

    // Close the connection
catch(IfxException e) 
    Console.ReadLine(); //Wait for a Return

Examples exchange | Troubleshooting

To find the PDF, see Publications for the IBM Informix 12.10 family of products.
For the release notes, documentation notes, and/or machine notes, see the Release Notes page.