How to Convert Boolean to StringBuilder Type in C#

Posted by Srikrishna777 under C# on 10/7/2009 | Views : 2114 | Status : [Member] | Replies : 1

I am fixing a bug where I have to typecast a boolean value to a stringBuilder type.But,I am not able to typecast.

The following line is the piece of code.

StringBuilder validData = (StringBuilder)ValidateCreditDetailsInfo.Invoke(reflectUserControl, null);

Here "ValidateCreditDetailsInfo.Invoke(reflectUserControl, null)" will return a boolean and How that can be converted to StringBuilder type.

Thanks Inadvance.

M.Srikrishna Murthy


Posted by: Cherry on: 10/7/2009 [Member] Starter

Convert boolean value to string and then convert string to stringbuilder.
Dim strbText As StringBuilder
Dim str As String
str = Convert.ToString(Booleanvalue)
strbText = New StringBuilder(str)

Srikrishna777, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response