The error is due to the line, which you have commented out...
You should initialize the
ConnectionString
property of
SqlConnection Class[
^] before using its instance (in your code that is
con
).
So, don't comment this line and try. Make sure the
ConnectionString
is correct.
Else follow -
http://connectionstrings.com/[
^] to find the correct and appropriate
ConnectionString
for your application.