IBM® Informix® Client Software Development Kit, Version 4.10

IfxConnection example

The following C# example shows how to use a constructor to set the connection string.
IfxConnection conn = new IfxConnection(
        "User Id=me;Password=myPassword;" +
        "Host=ajax;Server=myServer;" +
        "Service=9401;Database=superstores"
        );
IfxCommand cmd = new IfxCommand("select fname from customer", conn);
conn.Open();
IfxDataReader myReader = cmd.ExecuteReader();
while (myReader.Read())
{  
     Console.WriteLine("{0}", myReader.GetString(0));
}
myReader.Close();
myReader.Dispose();
cmd.Dispose();
conn.Close();
conn.Dispose();


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.