Connecting to a database
You connect to a database by using the Open method of an IfxConnection object.
About this task
attribute=value[;attribute=value]...
The brackets ([]) and the ellipsis (...) are not part of the string. They show that attribute/value pairs beyond the first are optional and any number of attribute/value pairs can be included. Separate attribute/value pairs from each other with a semicolon.
The full list of possible attributes is described in the topic IfxConnection class.
If you are using Microsoft™ Visual Studio you can create a connection visually:
Procedure
Results
IfxConnection conn=new IfxConnection("Host=berry; Service=9401;
Server=testserver;User ID=informix; password=ifxtest;
Database=testdb");
conn.Open();
An IfxConnection object can also determine the connection properties from the environment variables. If you set the properties in the connection string, the IfxConnection object uses those values. If you do not set the properties in the connection string, the IfxConnection object uses the values that are set by the environment.
However, you can set the value for the DELIMIDENT property in the registry by using the Setnet utility. If you do not set the value for the DELIMIDENT property in the connection string or in the environment, but you set it by using the Setnet utility, the IfxConnection object uses the value that you set with the Setnet utility.
In compliance with industry standards, the HCL® OneDB .NET Core Provider acts as though DELIMIDENT is set to Y unless you explicitly set it to N.
conn.Close();
Connection string attribute names are not case-sensitive, but often their values are not.