Results 1 to 2 of 2

Thread: Urgent !!! help

  1. #1
    Join Date
    Jun 2004

    Unanswered: Urgent !!! help


    I am working with oledb to connect to an Informix database, so, when i try
    to execute a select command to retrive data from a table that holds a money
    field, i get the following error:

    "Decimal byte array constructor requires an array of length four containing
    valid decimal bytes"

    This error is raised when the oledbdataadapter try to fill the dataset, it
    just only happens when i try to make a multiplication or division over the
    money field of the table.

    I would really appreciate your comments, ideas, suggestions..!

    Thanks in advance...

    I am using the following code:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles Button1.Click

    Dim sql As String = "select c.cod_credenciado, c.nom_credenciado, v.cod_empresa, " +"v.nom_empresa, sum(a.vlr_atendimento) as vlr_total_atend " + "from atendimento a "
    Dim strconn As String =
    ConfigurationSettings.AppSettings("CIRC_Connection String")

    AddHandler ad.FillError, New FillErrorEventHandler(AddressOf FillError)


    conn = New OleDbConnection(strconn)


    command = New OleDbCommand(sql, conn)

    command.CommandType = CommandType.Text

    ad.SelectCommand = command

    ad.Fill(ds, "prueba")



    DataGrid1.DataSource = ds


    Catch ex As OleDbException

    End Try

    End Sub

  2. #2
    Join Date
    Jun 2004

    Smile re: Urgent help

    I can´t help you with your oledb connection, but I had a few problems with the money datatype and I solve them changing the datatype from money to decimal or float. Maybe it can help you too.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts