Reputation: 563
I have written a simple wpf application for binding data in datagrid. It throws error while running at following line.
string ConString = System.Configuration.ConfigurationManager
.ConnectionStrings["ConString"].ToString();
Exception shows: Exception has been thrown by the target of an invocation."
InnerException:{"Object reference not set to an instance of an object."}
Upvotes: 1
Views: 3301
Reputation: 15367
Probably System.Configuration.ConfigurationManager.ConnectionStrings["ConString"] is NULL or System.Configuration.ConfigurationManager.ConnectionStrings is NULL.
Upvotes: 1