[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I  consulting a BD of Informix sinse Aspx.Net (with Code behind) (With VS 2005)? (sorry: i not speak english!)

Posted on 2008-11-06
6
Medium Priority
?
1,539 Views
Last Modified: 2013-12-24
Tengo el VS 2005 y programo en Aspx.Net, y quiero realizar unas consultas a una BD de Informix, pero no he podido hasta el momento. tengo el "IBM Informix Client-SDK 3.00" instalado en mi PC (Laptop Gateway con windows XP media center), y geneere un prog. en Aspx.Net con code Behind, (prog.aspx y su prog.aspx.vb), y me manda el sig. error: "The type initializer for 'IBM.Data.Informix.IfxConnection' threw an exception." y es el mismo error que me envia en VB 2005 cuando quiero agregar una connexion mas, le doy el Data source (IBM Informix (.Net Framework Data Provider for IBM Informix)), su Servername, su UserID su Password y su Base de datos(curso). Quiero llegar a realizar un ABC  con la BD de Informix con programacion de Aspx.Net. GRACIAS POR SU AYUDA.   atte. Silverio Vergara Godina.
Explicacion-Err-Aspx-BD-Informix.doc
0
Comment
Question by:SilverDemetrio
  • 3
  • 2
5 Comments
 
LVL 32

Expert Comment

by:Daniel Wilson
ID: 22899863
Please pardon me if I don't completely understand.  I'm using a machine translation which comes out as:
I have VERSUS 2005 and I program in Aspx.Net, and I want to realise consultations to one YOU of Informix, but I have not been able until the moment. I have " IBM Informix Client-SDK 3.00" installed in my PC (Laptop Gateway with average Windows XP center), and geneere prog. in Aspx.Net with code Behind, (prog.aspx and his prog.aspx.vb), and it sends sig to me. error: " The type to initializer for ' IBM.Data.Informix.IfxConnection' threw an exception." and it is the same error that it sends to me in VB 2005 when I want to add a connection but, I give Data source him (IBM Informix (. Net Framework Data for Provider IBM Informix)), its Servername, its UserID its Password and its Base of data (course). I want to get to realise an ABC with YOU of Informix with programming of Aspx.Net. THANKS FOR ITS AID.
Pardon por favor me si I don' t entiende totalmente.  I' m usando una traducción automática.

Can you post the full error message you are getting as well as the section of code that is generating that message?

¿Puede usted fijar el mensaje de error completo que usted está consiguiendo así como la sección del código que está generando ese mensaje?
0
 

Author Comment

by:SilverDemetrio
ID: 22901665
Gracias DanielWilson por responder.

Aqui te presento el programa y el lugar donde me da el error:  y tambien te mando un archivo en Word (MS) donde explico todo lo que estoy haciendo y que no me funciona.
Gracias nuevamente .!!

la funcion es :

Function Open_Ifx(ByVal CnnStr As String) As String
        Open_Ifx = "-1"
        Dim oIFXCConnection As IBM.Data.Informix.IfxConnection
  'En la sig. linea marca el error sig.
        'Error: The type initializer for 'IBM.Data.Informix.IfxConnection' threw an exception.
      ' Error in next line
        oIFXCConnection = New IfxConnection(CnnStr) 'Linea donde marca el error
                                                            'Error:   The type initializer for 'IBM.Data.Informix.IfxConnection' threw an exception
        Try
            oIFXCConnection.Open()
            Me.txt1.Text = "Conexion realizada!"
            Me.txt1.BackColor = Drawing.Color.Red
            Me.txt1.ForeColor = Drawing.Color.White
            Me.txt1.Font.Bold = True
        Catch ex As Exception
            Me.txt1.Text = "Problemas con Conexion : attempt: (" + ex.Message + ") "
        End Try
        oIFXCConnection.Close()
    End Function
 ------

tengo el : IBM Informix Client-SDK 3.00 para .Net

------
los dos prog. son los siguientes:

Programa: Open_Ifx_3.Aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Open_Ifx_3.aspx.vb" Inherits="Open_Ifx_3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Open Ifx 3</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    <asp:Button ID="btn1" runat="server" Text="Inicio Cnn" />
        <br />
        <asp:Button ID="btnA" runat="server" Text="Btn-A" />
        <asp:TextBox ID="txtA" runat="server" Font-Size="Small" Width="870px"
            Text="Provider=Ifxoledbc.2;password=MiPass;User ID=MiUserId;Data Source=Curso@MiServer;Persist Security Info=true;  "
            ></asp:TextBox>
        <br />
        <asp:Button ID="btnB" runat="server" Text="Btn-B" />
        <asp:TextBox ID="txtB" runat="server" Font-Size="Small" Width="870px"
            Text="Provider=Ifxoledbc.2;password=MIUSERID;User ID=MIPASS;Data Source=Curso@MiServer;Persist Security Info=true;  "
            ></asp:TextBox>
        <br />
        <asp:Label ID="lbl1" runat="server" Text="Mensaje: " BackColor="Red" ForeColor="White"></asp:Label>
        <br />
        <asp:TextBox ID="txt1" runat="server" Width="817px" Height="72px" Rows="6" TextMode="MultiLine" BackColor="#C0FFC0"></asp:TextBox>
        <br />
         <asp:Label ID="lbl2" runat="server" Text="Cnn-Ejec.: "></asp:Label>
        <asp:TextBox ID="txt2" runat="server" Width="809px"></asp:TextBox>
       
    </div>
    </form>
</body>
</html>


Programa: Open_Ifx_3.Aspx.vb


Imports System.Data
Imports System.IO
Imports System.IO.TextWriter
Imports System.IO.StreamWriter
Imports IBM.Data.Informix
Imports IBM.Data.Utilities
Imports System.Data.Odbc
Imports Microsoft.VisualBasic.AppWinStyle
Imports System.Web
Imports Microsoft.VisualBasic

Partial Class Open_Ifx_3
    Inherits System.Web.UI.Page

    Public Shared strPaso As String = ""
    '=====================================================
    Function Open_Ifx(ByVal CnnStr As String) As String
        Open_Ifx = "-1"
        Dim oIFXCConnection As IBM.Data.Informix.IfxConnection
  'En la sig. linea marca el error sig.
        'Error: The type initializer for 'IBM.Data.Informix.IfxConnection' threw an exception.
        ' Error in next line
        oIFXCConnection = New IfxConnection(CnnStr) 'Linea donde marca el error
        Try
            oIFXCConnection.Open()
            Me.txt1.Text = "Conexion realizada!"
            Me.txt1.BackColor = Drawing.Color.Red
            Me.txt1.ForeColor = Drawing.Color.White
            Me.txt1.Font.Bold = True
        Catch ex As Exception
            Me.txt1.Text = "Problemas con Conexion : attempt: (" + ex.Message + ") "
        End Try
        oIFXCConnection.Close()
    End Function

    Protected Sub btnA_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnA.Click
        Me.Open_Ifx(Me.txtA.Text)
    End Sub

    Protected Sub btnB_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnB.Click
        Me.Open_Ifx(Me.txtB.Text)
    End Sub
End Class



Explicacion-Err-Aspx-BD-Informix.doc
0
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 2000 total points
ID: 22921211
I think you are trying to use a connection string for OLEDB with the IBM Informix .NET Provider.  You need a connection string for the IBM Informix .NET Provider.
Pienso que usted está intentando utilizar una secuencia de la conexión para OLEDB con el abastecedor de IBM Informix .NET. Usted necesita una secuencia de la conexión para el abastecedor de IBM Informix .NET.

http://connectionstrings.com/?carrier=informix
Try this:
Intente esto:
Database=myDataBase;Host=192.168.10.10;Server=db_engine_tcp;Service=1492; Protocol=onsoctcp;UID=myUsername;Password=myPassword;
0
 

Author Comment

by:SilverDemetrio
ID: 23378406
DanielWilson greetings!
Thousand excuses by to have answered, that in December I had several problems with my Laptop where it was realising the tests with another servant, I did not only have to format my laptop since they commented friendly to me that tapeworm already many driver of infromix of several versions and nontapeworm special driver for the version of infromix who was working, since it was trying to extract the information of a servant who nonsabiamos the version of his informix, and still they do not say to look for me driver for this version of informix. So until now I do not have the exact version nor driver and anus obtaining a PC of tests.
THANKS for your aid and sera after it continues with the tests, as it wants itself in contact.
Agradesco you& until soon!
Silverio Vg.
P.D.: it excuses the writing since traduccio with Babel Fish is one& THANKS.

Spanish:

Saludos DanielWilson !
Mil disculpas por no haber contestado, solo que en diciembre tuve varios problemas con mi Laptop donde estaba realizando las pruebas con otro servidor, tuve que formatear mi laptop ya que me comentaban unos amigos que tenia ya muchos driver de infromix de varias versiones y no tenia el driver especial para la version de infromix que estaba trabajando, ya que estaba intentando extraer la informacion de un servidor que no sabiamos la version de su informix, y todavia no me dicen para buscar el driver para dicha version de informix.  Asi que hasta ahora no tengo la version exacta ni el driver y ano consiguiendo una PC de pruebas.

GRACIAS por tu ayuda y sera despues que continue con las pruebas, como quiera sigo en contacto.

Te agradesco... hasta pronto !

Silverio VG.
0
 

Author Comment

by:SilverDemetrio
ID: 23378429
Aprovechando la Oportunidad....

Los mejores Deseos para este 2009, Mucha Salud y Trabajo...

Silverio VG.

(Taking the Opportunity&. Best Desires for this 2009, Much Health and Work&)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
What we learned in Webroot's webinar on multi-vector protection.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question