Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecto to Database Informix

Status
Not open for further replies.

dcampo

Programmer
Jun 13, 2006
71
EC
Hi...


What i need for connect my web site to Database Informix?
Any *.dll?

Please help me!!

Thanks
 
Thanks dvannoy

The connectionString is correct... Now, how i can use it. For example:

If I will use a Database SQL, the connection is::

con = ConnectionString
SqlConnection variable = new SqlConnection(con)

And an Informix?
Do I need download any program?

Thanks
 
you will have to use OLDDB to get your records since SQLClient is only for SQL Server.

Dim Cn As New OleDbConnection(YourConnectionString)

Dim SQL As String = "SELECT your Records FROM Table"

Dim Cmd As New OledbCommand(SQL, Cn)

Cn.Open()

I don't use OLEDB so this is just from memory but it should get your started..


 
Ok.

I looked the Informix Client 2.9 SDK, I found and installed in my computer. Now in the Visual Web Developer, add the reference Ibm.Data.Informix.dll for use the functions IfxConnection, IfxCommand.... but when I compiled my website, appear this message:

The type initializer for 'IBM.Data.Informix.IfxConnection' threw an exception.

This message appear in the line:
IfxConnection ocon = new IfxConnection(infcon)

Look my code and you tell me, Where is the error?

//------------------------------------------------------------------------------------------------------------------
using IBM.Data.Informix
...
...
...

string infcon = "Dsn='pautas2';Driver={INFORMIX ODBC DRIVER};Host=gensa;Server=gensa;Service=sqlturbo;Protocol=olsoctcp;Database=pautas;UID=informix;PWD=rrah2000";

IfxConnection ocon = new IfxConnection(infcon);
try
{
ocon.Open();
this.lbl1.Text = "Se conecto";
}
catch
{
this.lbl1.Text = "Fallo la conexion";
}
ocon.Close();


I'm programing in Visual C# 2005 with Visual Web Developer 2005 Express.

Help me, please.

Thanks
 
you may be able to use there dll and reference it but it would be faster to use OLEDB. if you need help with there dll then you will have to go to there support for that.

 
Thanks dvannoy

If I'd use OleDb but with Informix, How Can I do it?

I saw you example of OleDb for Sql Server but I need do it for a Database Informix

Or its the same commands? OleCommnad.. for any Databases.

Thanks
 
OLEDB can be used on most db's if not all..all your doing is access data from a table that's it. the reason you should not use OLEDB with sql server is performance I think.

look at my example and also ca8msm providing a good link to the help files. search around, there are TONS of examples on this.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top