Re: bytes to string conversion
- From: GIKICIKMAZ GIKICIKMAZ <gikicikmaz@xxxxxxxxxxx>
- Date: Fri, 07 Oct 2005 00:44:32 -0700
Hi,
In my SQL Server I have a table call tbl_USER. And this table contains
for field as:
ID, mREALNAME, mUSERNAME, mPASSWQORD
I can connect sql server and retrive the data intoi the DataSet. However
the mUSERNAME, mPASSWQORD field uses binary data type.
I have to convert this binary data into the string so I can compare it.
The reason I am chossen this way is some other problem that I am having
to Encrpty to the data.
Here is my parital code that try to convert binary data into string:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
For Each CHECKROW In CHECKTABLE.Rows
Dim dBytes() As Byte = (CHECKROW("mUSERNAME"))
Dim mUSER As String
Dim enc1 As New System.Text.UTF8Encoding
Dim str1 As String = System.Text.Encoding.GetEncoding
(437).GetString(dBytes)
....
....
....
Next
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The problem is my str1 string only have 1 character and that is the
character "N"
My user name is NIYAZI in Turkish which is the character "I" has and
small dot on top it.
Now how can I get right string after converting byte() that is value
comes from SQL Server (in a binary data type)
I try to use varbinary data type in SQL server and I still couldn't get
right information.
I will appricate if anyone show me somne light to this problem.
Thank you for reading this.
Rgds,
GC
*** Sent via Developersdex http://www.developersdex.com ***
.
- Prev by Date: dataview problem
- Next by Date: Re: Expression
- Previous by thread: dataview problem
- Next by thread: Re:DAAB, Enterprise Lib, connection timeout.
- Index(es):
Relevant Pages
|