hi frnds
my connection string is
string constr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
and in web.config
but i am getting the error like
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 39:
{ Line 40: List
Line 41: string constr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
Line 42:
Line 43: using (SqlConnection con = new SqlConnection(constr))

Ramesh PalanivelRank #372 · 6.8K reputationPosted Apr 20, 2017, 4:15 AM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Apr 20, 2017, 5:17 AM EDT
Ravi PatelRank #439 · 5.7K reputationPosted Apr 20, 2017, 5:23 AM EDT
Jitendra ShekhawatRank #1,909 · 772 reputationPosted Apr 20, 2017, 5:24 AM EDT
Jitendra ShekhawatRank #1,909 · 772 reputationPosted Apr 20, 2017, 5:26 AM EDT