2

In a winforms application i 'm storing one Wingdings char in a SQL Server 2005 field of type NVARCHAR(1).

Storing, retrieving and showing up this char in a control works fine.

The problem i'm facing is this: how to search for records which have a specific wingding char value: for example

Select * from table where FieldWithWingding = valueOfLeftArrowChar

How to achieve this?

Thanks in advance

Savvas Sopiadis
  • 8,213
  • 10
  • 34
  • 53

3 Answers3

4

Wingdings is a font! Fonts give a special appearance to characters in a given character set. The left-arrow is therefore a character. Look it up in start->all programs->Accessories->System tools->Character map

Your select will be something like:

Select * from table where FieldWithWingding = 'ß'
Klaus Byskov Pedersen
  • 117,245
  • 29
  • 183
  • 222
  • Additionally, you could use the CHR() function. Character map will also show you the hex code for the character. – GalacticCowboy Mar 26 '10 at 11:09
  • It's actually a typeface. :-P – MSpeed Mar 26 '10 at 11:47
  • @klausbyskov I know it is a font. The problem is when i get the value (using Visual Basic ComboBoxSearch.SelectedItem().ToString) in the debugger i get a value with a...dot. This is pretty useless while debugging. @GalacticCowboy i cannot see the benefit of using chr() but i will have a closer look at it. – Savvas Sopiadis Mar 26 '10 at 11:50
1

Igor pointed me into the correct direction: it's actually

Select * from table where FieldWithWingding = N'ß'

Works fine!

Thank you everybody!

Savvas Sopiadis
  • 8,213
  • 10
  • 34
  • 53
0

Try this: select Unicode(N'ß'), Nchar(Unicode(N'ß'))

Use @filter nvarchar(1) or nchar(1) data types

garik
  • 5,669
  • 5
  • 30
  • 42