I am having below piece of code where i try to connect to IBM's Informix database.
public void MakeConnection()
{
string ConnectionString = "Database=databasename;Host=ipaddress;Server=servername;Service=port;Protocol = olsoctcp; UID = userid; Password = password;";
IfxConnection conn = new IfxConnection();
conn.ConnectionString = ConnectionString;
try
{
conn.Open();
}
catch (IfxException ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadLine();
}
Getting below error on opening a connection.
ERROR [HY000] [Informix .NET provider][Informix]Database locale information mismatch.
When i try connecting using windows ODBC Data sources
application, by creating a new user data source under User DSN and providing all necessary values under each section of Informix ODBC driver setup
, i am able to connect successfully.
All i understand is that the client application's and database's Database Locale
value should be same for proper query execution, and i have tried using en_US.57372 and en_US.UTF8
DB Locale while configuring in user DSN's which worked pretty well. I am posting here a image for better understanding.
Appreciate if anyone can help me in knowing where i can find DB Locale configured for in an Informix database and also in detail on what actually causes for this error.
SELECT * FROM systables WHERE tabid IN ( 90, 91 );
. After that you can add the locale information to your connection string ( check the online Informix .net documentation ). – Luís Marques