DataGrid showing "System.Byte[]" for a column that should be a str

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok, I hope this is something easy... but I have been staring at this for way
too long.

I have the following query ( ODBC conn setup to MySQL ):

SELECT MonthName(dateOfOrder) as month, SUM(cost) as sales FROM orderInfo,
imagesInOrder WHERE orderInfo.id=imagesInOrder.order_id Group By
Month(dateOfOrder)

which returns the following when I iterate over the OdbcDataReader:

June, 10.88
July, 22.96
August, 41.06

However, when I bind this query to a DataGrid, the DataGrid shows:

System.Byte[] $10.88
System.Byte[] $22.96
System.Byte[] $41.06

Any ideas? I don't understand why the correct string value ( i.e. the month
name ) is fine when I iterate over the OdbcDataReader, but when I bind it to
a grid it gets messed up?

Thanks much in advance,
Justin
 
Why are you using ODBC to connect to mysql anyway heh, use MySQL.Net to
connect: http://www.sf.net/projects/mysqlnet/ - its an ADODB.Net compliant
library - very good quality ;)

- Mark

Ok, I hope this is something easy... but I have been staring at this for
way
too long.

I have the following query ( ODBC conn setup to MySQL ):

SELECT MonthName(dateOfOrder) as month, SUM(cost) as sales FROM
orderInfo,
imagesInOrder WHERE orderInfo.id=imagesInOrder.order_id Group By
Month(dateOfOrder)

which returns the following when I iterate over the OdbcDataReader:

June, 10.88
July, 22.96
August, 41.06

However, when I bind this query to a DataGrid, the DataGrid shows:

System.Byte[] $10.88
System.Byte[] $22.96
System.Byte[] $41.06

Any ideas? I don't understand why the correct string value ( i.e. the
month
name ) is fine when I iterate over the OdbcDataReader, but when I bind
it to
a grid it gets messed up?

Thanks much in advance,
Justin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top