2

i am making application in c#.In that application i am using Code as

 private void WriteCurrentData(HttpRequest request, TextWriter writer)
{
      Stream = Convert.ToString(objstream.m_StreamData[1]);
      writer.WriteLine(string.Format(Stream));
      writer.Flush();
}

where m_StreamData is ArrayList. but sometimes i am getting error as

System.FormatException: Input string was not in correct format at System.Text.StringBuilder.AppendFormat() at System.String.Format()

Please Help me.Thanks in advance.

1
  • 1
    Why do you use string.Format ? May be use writer.WriteLine(Stream); Commented Mar 2, 2012 at 7:25

1 Answer 1

3

The String.Format() inside your WriteLine() tries to interpret the string (again). You already converted it to a string, so:

//writer.WriteLine(string.Format(Stream));
writer.WriteLine(Stream);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.