Wednesday, 3 February 2016
Object reference not set to an instance of an object error Solution in C#,Asp.net
If you run your c# code some times it gives error as Object reference not set to an instance of an object.
Problem :
If you declare an list like List<string> list; or any thing.
Solution :
In C# programming language you must and should declare List with string or any type as
List<string> list = new List<string>();
list.Add("First");
list.Add("Second");
...
Problem :
If you declare an list like List<string> list; or any thing.
Solution :
In C# programming language you must and should declare List with string or any type as
List<string> list = new List<string>();
list.Add("First");
list.Add("Second");
...
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment