D
David Wang
HI,
Please look at following code example:
string convert2string(byte [] bys)
{
string string1 = Encoding.ASCII.GetString(bys, 0, 30).TrimEnd(null);
return string1;
}
byte [] allzero = new byte [40];
string dbstr = convert2string(byte);
After I get dbstr(which is empty), I write it to SQL database. When I read
this from database again, and serilize to XML message, I see
..... which means dbstr actually was not empty,
it filled with all "0" inside. Can anybody explain why? How can I get rid of
it? Thank you.
David
Please look at following code example:
string convert2string(byte [] bys)
{
string string1 = Encoding.ASCII.GetString(bys, 0, 30).TrimEnd(null);
return string1;
}
byte [] allzero = new byte [40];
string dbstr = convert2string(byte);
After I get dbstr(which is empty), I write it to SQL database. When I read
this from database again, and serilize to XML message, I see
..... which means dbstr actually was not empty,
it filled with all "0" inside. Can anybody explain why? How can I get rid of
it? Thank you.
David