Reputation: 23
I have installed the Informix Client SDK. Then I created a simple .net console application referencing IBM.Data.Informix.dll. When I call IfxConnection.Open()
it throws an exception.
ERROR [HY000] [Informix .NET provider][Informix]INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES. sqlerrm(database)
I have seen this post and I can't seem to find the sqlhosts file in the client machine. Also I can't the environment variables mentioned the post as well.
So my questions are:
Upvotes: 2
Views: 5678
Reputation: 970
In a Windows machine the needed configuration is defined by the Setnet32 utility (installed with the Informix Client SDK). You need to set your Informix instance values in that utility for the connection provider to work (Informix .NET Provider).
First define your "Host Information" in the third tab and then click apply (btw I'm in a spanish Windows machine!):
Note: The "Current Host" value should be added to your hosts Windows file (%WINDIR%\System32\drivers\etc\hosts
).
Afterwards, define your "Server Information" in the second tab:
INFORMIXSERVER
).%WINDIR%\System32\drivers\etc\services
)After these changes you should be able to run your .NET application. Obviously your connection string values should match the information defined in this utility.
Upvotes: 1