-2

Can anyone tell me what is wrong with this code?

 String LineNo;
 LineNo = txtLineNumber.Value.ToString();

It is giving me the titled error message.

Thanks

Chrislaar123
  • 323
  • 2
  • 6
  • 17
  • 3
    The Value would be null, try using .Text – Adil Mar 31 '15 at 08:48
  • [What is a NullReferenceException and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Otiel Mar 31 '15 at 08:49

1 Answers1

0

Either txtLineNumber does not exist or txtLineNumber.Value is null;

Code Uniquely
  • 6,356
  • 4
  • 30
  • 40