Click here to Skip to main content
14,486,715 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have data from database with symbol µ (micron) but cannot displaying on text box, the symbol change to (?)

What I have tried:

this is my code:

Call connection()

If Not connection() Then
AlertControl.Show(Me, "Connection Failed", "Information")
Exit Sub
End If

cmd = New FbCommand("Select i.RESERVED6,
From item i", cnCOA2)

rdr = cmd.ExecuteReader
rdr.Read()

If rdr.HasRows Then

TextBox40.Text = rdr.Item("RESERVED6")

End If

If cnCOA2.State = ConnectionState.Open Then
cnCOA2.Close()
End If
Posted
Updated 19-Mar-20 22:47pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Check your DB: make sure it's being stored in a NVARCHAR column, not a VARCHAR.
The difference is that NVARCHAR is Unicode, VARCHAR is ASCII - and the µ symbol is Uncode, like the textbox.
After that, provided the text box is using a font containing the µ symbol (and it is by default) it should work fine.

If it's currently a VARCHAR, you will probably have to reload all contents to get you symbols to work.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100