Inserting C # char variables into ADO Char field (1)
I am experiencing this rather strange decimal complement to my char value during conversion.
Tried the following conversion, but the decimal just keeps getting assigned along with the char to the variable:
-
Convert.ToChar(Console.ReadLine());
-
Console.ReadLine().ToString()[0];
-
Console.ReadKey().KeyChar;
An object containing a char field:
Scheme:
@DAL Error: System.Data.SqlClient.SqlException: "String or binary data will be truncated.
USAGE: .NET Standard Libs
source to share
Your char is displayed with only a decimal value in front of it. So the decimal value is the ASCII value of the character. You can easily check this by typing the value and you will see that it only contains a character. If you want to test it while debugging, I would suggest using it employeeGrade.ToString()
in viewports.
It would be impossible for char to hold the value 90'Z ', because that would be multiple characters. You can see ASCII values in ASCII table like this: http://ascii.cl/ .
source to share