I’m working against a Informix DB from C# ASP .Net 4.0 via an ODBC connection. This database does change frequently so I read out what DBs that are installed from the sysmaster table.
Depending on choice my user makes I need to setup a ODBC connection to the choosen DB or change the current connection to change from the systmaster DB to the one choosen.
Anyone got any idea how to do this? I suspect it must be possible to setup a temporary ODBC connection. Also in Visual Studio under the properties for my ODBC connection I do have a connection string looking like this:
Dsn=Informix;uid=xxxxx;database=sysmaster;host=10.10.10.10;srvr=testdb1;serv=3000;pro=onsoctcp;cloc=en_US.819;dloc=en_US.819;vmb=0;curb=0;scur=0;icur=0;oac=1;optofc=0;rkc=0;odtyp=0;ddfp=0;dnl=0;rcwc=0
I have looked around for a library to connect directly without the ODBC to informix but with now success.
Thanks,
Stefan
I have worked out a working solution that is quite nice. I did not realise .NET had full support to do this from code behind without actually modifying the ODBC settings.
I guess you have to setup a working ODBC connection one before trying the code behind to just be sure the Driver can be located ok or at least look in the list of available ODBC drivers.