Friday, 11 April 2014

nullreferenceexception was unhandled in ASP.Net or C#

Hi Folks,
I got the below error

nullreferenceexception was unhandled

And I browsed so much for the solution....finally i understood that all I had to do was check the connectionstring name

i,e i had
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["CCDBRegistrationString"].ConnectionString);

while the correct connection string name was

SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["CCDBConnectionString"].ConnectionString);

No comments:

Post a Comment