473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Byte Array, Datagrid

Hi, I am reading Byte Array from MS-Access table, which I wanted to display
in the datagrid. Right now its displayed as "Byte[] array". How can I
display the actual string.

Any help!

Selva
Jan 6 '06 #1
4 1866
Selva Chinnasamy wrote:
Hi, I am reading Byte Array from MS-Access table, which I wanted to display
in the datagrid. Right now its displayed as "Byte[] array". How can I
display the actual string.

Any help!

Selva


Can you show some of your code.

Chris
Jan 6 '06 #2
Chris,

Column Text is Binary type. Because we want to store unicode's also this was
created 7 years back where access doesnt store it as Unicode.

strSQL = "SELECT FIXEDTEXT.FixedTextRecordID, FIXEDTEXT.Text "
strSQL &= "FROM(FIXEDTEXT) "
strSQL &= "WHERE(((FIXEDTEXT.ScreenName) = '" & m_ScreenName & "')) "
strSQL &= "ORDER BY FIXEDTEXT.FixedTextRecordID"

Dim oDA As New OleDbDataAdapter(strSQL, cnLang)
Dim oDS As New DataSet

'throw a custom exception
'AddHandler oDA.FillError, AddressOf FillError

oDA.Fill(oDS, "FIXEDTEXT")

dgdFixedText.DataSource = oDS
dgdFixedText.DataMember = "FIXEDTEXT"

Looking forward your suggestions.

Selva

Jan 6 '06 #3
Selva wrote:
Chris,

Column Text is Binary type. Because we want to store unicode's also this was
created 7 years back where access doesnt store it as Unicode.

strSQL = "SELECT FIXEDTEXT.FixedTextRecordID, FIXEDTEXT.Text "
strSQL &= "FROM(FIXEDTEXT) "
strSQL &= "WHERE(((FIXEDTEXT.ScreenName) = '" & m_ScreenName & "')) "
strSQL &= "ORDER BY FIXEDTEXT.FixedTextRecordID"

Dim oDA As New OleDbDataAdapter(strSQL, cnLang)
Dim oDS As New DataSet

'throw a custom exception
'AddHandler oDA.FillError, AddressOf FillError

oDA.Fill(oDS, "FIXEDTEXT")

dgdFixedText.DataSource = oDS
dgdFixedText.DataMember = "FIXEDTEXT"

Looking forward your suggestions.

Selva

Well I can think of a couple suggestions for you.

1. Do a one time convert of all the data in your Access table out of
binary to a nicer type.

2. After you pull the data into the datatable, loop through it and
convert it out of binary. Look in the help file at the encoding class
to do that.

3. Make a custom DataGridTextBoxColumn that converts it for you as it
displays it. You then will make a DataGridTableStyle and add your new
DataGridTextBoxColumn to it. There is a lot of info around on how to
make custom columns like that.

Hope it helps
chris
Jan 6 '06 #4
Selva,

I completely agree with Chris, for the way that you look for the way to
convert a binary array to another type, have than a look at this sample.
Yours is a little bit extraordinare therefore you will probably not find an
sample.

However you will probably need the encoding class

http://msdn2.microsoft.com/en-us/lib....encoding.aspx

I hope this helps,

Cor
Jan 6 '06 #5

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

Similar topics

16
by: Ekim | last post by:
hello, I'm allocating a byte-Array in C# with byte byteArray = new byte; Now I want to pass this byte-Array to a managed C++-function by reference, so that I'm able to change the content of the...
15
by: Kueishiong Tu | last post by:
How do I convert a Byte array (unsigned char managed) to a char array(unmanaged) with wide character taken into account?
8
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
1
by: Jim Hammond | last post by:
How can one bind a database image column (the byte array - not the path) to a datagrid column? The closest thing I have found so far is this January 2002 statement by Dino Esposito: "Likewise,...
5
by: Robin Tucker | last post by:
I need to marshal an IntPtr (which I've got from GlobalLock of an HGLOBAL) into a byte array. I know the size of the array required and I've got a pointer to the blob, but I can't see how to copy...
2
by: Bryan | last post by:
Apologies if this is a noob question, but I've been struggling with this for quite a while... I'm trying to convert a byte array (encrypted authorization code) into a *screen-printable* string...
3
by: simonc | last post by:
Can you define a property as type Byte array of a specific length? I am trying to pass a byte array which is 3200 bytes in length from one form (in which the bytes are read from a file) to...
10
by: Scott Townsend | last post by:
So I need to talk to a devices that expects all of the bits and bytes I sent it to be in specific places (not yet 100% defined). I wanted to create a structure/class with all of the data in it...
2
by: O.B. | last post by:
When using Marshal to copy data from a byte array to the structure below, only the first byte of the "other" array is getting copied from the original byte array. What do I need to specify to get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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,...
0
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...

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.