1

alt text

I did a select statement in sql and 1 of the column return me this. There is a need to query from that sql column, but as this is an existing system, I can only try and error.

From the characters, I have already confirmed if the numbers inside is 0015, I should get 15. Problem is as you can see above, it contains more than one number, and I have to compare the numbers.

Using SQL Server and C# programming, can some1 guide me on how to retrieve these individual numbers in sql server as well as the data type in C#

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
C_Rance
  • 661
  • 12
  • 25

1 Answers1

0

In C#, you can directly assign ASCII codes to char. So, for instance, char c = (char)0x0041;

will assign character repesented by 0x0041, which in this case is 'A', directly to c. You can later convert to string, if necessary, by executing

string s = new string(c);

devsh
  • 21
  • 1