cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting .Net C# CR Viewer to Informix without using ODBC

Former Member
0 Kudos

I have C# application using what I believe is the latest CR assemblies (13.0.2000.0) to connect to an Informix database via ODBC.  Works fine.  But, I need to bypass ODBC and connect the report directly to the Informix database. 

Tables tables = _reportDocument.Database.Tables;

                ConnectionInfo connectionInfo = new ConnectionInfo();

                foreach (Table table in tables)

                {

                    TableLogOnInfo tableLogOnInfo = new TableLogOnInfo();

                    tableLogOnInfo = table.LogOnInfo;

                    connectionInfo.ServerName = "InformixOdbcName";

                    connectionInfo.DatabaseName = "ProdDbName";

                    connectionInfo.UserID = "UserId";

                    connectionInfo.Password = "Password";

                    // Now the update ConnectionInfo in the object

                    tableLogOnInfo.ConnectionInfo = connectionInfo;

                    table.ApplyLogOnInfo(tableLogOnInfo);

                }

The above works fine with ODBC and the appropriate values.  But, when trying to set the ServerName directly to Informix: <host>@<servername>, the logon always fails.  Can anyone provide some help on how to connect directly to Informix?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Why can't you use ODBC?

OLE DB would connect to the Server by name or IP and would not need a DSN defined before using your app.

Need more info on why?

Don

Former Member
0 Kudos

Can someone point me to an example of C# connecting the report/subreport tables to the db using OleDB?

The only example I have is using the ODBC datasource.

0 Kudos

In your connection info just replace the DSN name with the server name.

Search this forum for logon database. Lot's of example code snippets.

If you want to replace the connection at runtime then search for ReplaceConnection and you'll find code also as well as an application that will generate the code to use for you.

Don

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Hi John

By "connect directly" do you mean OLE DB? CR does not have a native connection DLL for Informix, so the only options would be ODBC or OLE DB.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter