Gives solution for any Error occurs in any Programming Language, .Net Core 3.1, 3.0, C#,Asp.Net,Sqlserver,MVC,Java,Php,Html,Css,Jquery,errors and solutions,Latest News,Technology

Wednesday, 3 February 2016

Object reference not set to an instance of an object error Solution in C#,Asp.net

No comments :
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");
...



No comments :

Post a Comment