If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Urgent !!! help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-09-04, 13:20
alysson alysson is offline
Registered User
 
Join Date: Jun 2004
Posts: 1
Urgent !!! help

Hi,

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)

Try

conn = New OleDbConnection(strconn)

conn.Open()

command = New OleDbCommand(sql, conn)

command.CommandType = CommandType.Text

ad.SelectCommand = command

ad.Fill(ds, "prueba")

command.Dispose()

conn.Close()

DataGrid1.DataSource = ds

DataGrid1.DataBind()

Catch ex As OleDbException

End Try

End Sub

Alyssonjedi@hotmail.com
Reply With Quote
  #2 (permalink)  
Old 06-09-04, 16:04
Fernanda Fernanda is offline
Registered User
 
Join Date: Jun 2004
Posts: 7
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.

Fernanda.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On