473,662 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

JW
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(dateO fOrder) as month, SUM(cost) as sales FROM orderInfo,
imagesInOrder WHERE orderInfo.id=im agesInOrder.ord er_id Group By
Month(dateOfOrd er)

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
Nov 18 '05 #1
1 2098
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

On Tue, 24 Aug 2004 22:01:03 -0700, JW <JW@discussions .microsoft.com>
wrote:
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(dateO fOrder) as month, SUM(cost) as sales FROM
orderInfo,
imagesInOrder WHERE orderInfo.id=im agesInOrder.ord er_id Group By
Month(dateOfOrd er)

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


--
Mark Harris
Head Developer
GameHost CP
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2467
by: Jerry Sievers | last post by:
Hello. Maybe I'm just out of practice, maybe not. Suppose we run a command using system() and this command writes to the stderr stream. If I remember correctly, this is normally written to the Apache error log file. log_errors is ON and error_reporting is 2047 E_ALL. Redirecting the stderr from the system command has it showing up on the browser output.
22
3701
by: bq | last post by:
Hello, Two questions related to floating point support: What C compilers for the wintel (MS Windows + x86) platform are C99 compliant as far as <math.h> and <tgmath.h> are concerned? What wintel compilers support a 16-byte "long double" (with 33 decimal digits of accuracy) including proper printf() support. I found some compilers that did support "long double", but theirs was an 8-byte or 10-byte or 12-byte type with accuracy the...
0
339
by: Asaf | last post by:
Hi, When I am doing a POST to a SSL URL I am getting this error on first attempt "Cannot access a disposed object named "System.Net.TlsStream"." After the first attempt all works fine, here is the Stack Trace at System.Net.TlsStream.InnerWrite(Boolean async, Byte buffer, Int32 offset, Int32 size, AsyncCallback asyncCallback, Object asyncState) at System.Net.TlsStream.BeginWrite(Byte buffer, Int32 offset, Int32 size, AsyncCallback...
5
4429
by: _BNC | last post by:
I've converted " byte" to "byte *" at times, using 'unsafe' and fixed { .... }, but the reverse does not seem to work. In this case, a C++ DLL returns a byte * and a length. What is the best way to convert these to straight C#-compatible straight " byte" arrays? PS: The C++ DLL is actually managed and I have access to the source. Perhaps there is a simpler syntax for doing the conversion there, and returning a C# compatible array...
0
3115
by: bnlockwood | last post by:
G'day all, Thank you in advance for anyone that can help. I have a shopping cart datagrid on my c# asp.net page. This is the code: ------------------------------------- <asp:datagrid id="grdShoppingCart" OnItemDataBound="ItemDB"
0
2670
by: woollymammoth | last post by:
I can't assign a MS SQL Server table record value to a simple VB variable, should be an easy thing. Sample SQL Server table has the data in the record as a char(30) string, the column for that record is named "Try". The VB script function accessing the record value is running on a web hosting server with ASP.Net 2.0 on a web page. Result always is it "can't convert from a Field to type 'String'". Printing out the SQL variable results in...
2
3436
by: =?Utf-8?B?cmVk?= | last post by:
Hi Friends, We recently deployed our application to production and I am experiencing the below error message. Cannot access a disposed object named "System.Net.TlsStream" The error occurs when we are making a web service call to an external system (within our corporate n/w). The method is POST and the URL is over HTTPS.
5
1649
by: Chris Botha | last post by:
There is a database table with one of the columns named "System". When creating a new Dataset for this table, the project gives a huge number of compile errors. If I change the column name to be anything else than "System" and re-generate the Dataset, it works. The problem is that this is an existing database and there is no way that the column name will be changed.
4
1488
by: Chris Botha | last post by:
The customer has a database with a column in a table named "System". I've been using this method for years now - create a dataset (an .xsd file) for the table. With a column named "System" in the dataset, it gives a substantial number of compile errors. To simplify the problem, add a Dataset with one table and one column called "System" - below follows how it can be done: Right click on the solution, click "Add", click "New Item" and...
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.