Use ‘ToString’ to convert the StringBuilder to String
// Appending String - using String Builder
System.Text.StringBuilder CompleteAddress1 = new
System.Text.StringBuilder();
CompleteAddress1.Append( "105, Annanagar ");
CompleteAddress1.Append( "Chennai ");
CompleteAddress1.Append( "Tamil Nadu ");
// Error Code
//MessageBox.Show(CompleteAddress1);
// corrected Code
MessageBox.Show(CompleteAddress1.ToString() );
Argument '1': cannot convert from 'System.Text.StringBuilder' to 'string' Error
No comments:
Post a Comment