Object Reference not set to an instance of an object
Object Reference not set to an instance of an object
(OP)
Afternoon All!
I hope this is the right forum, if not, please let me know!
I'm in the process of creating a VB, web based application, with an SQL back-end.
I have multiple forms completed and working fine, however, I now have an issue with the following line of code and I have absolutely no idea why!
Public constr As String = ConfigurationManager.ConnectionStrings("ABMSOPConnString").ConnectionString
Any advice would be gratefully recieved....any further information required then plase let me know.
Many thanks
Steve
I hope this is the right forum, if not, please let me know!
I'm in the process of creating a VB, web based application, with an SQL back-end.
I have multiple forms completed and working fine, however, I now have an issue with the following line of code and I have absolutely no idea why!
Public constr As String = ConfigurationManager.ConnectionStrings("ABMSOPConnString").ConnectionString
Any advice would be gratefully recieved....any further information required then plase let me know.
Many thanks
Steve
RE: Object Reference not set to an instance of an object
Did you remember to put "Imports System.Configuration" at the top of the form code?
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
RE: Object Reference not set to an instance of an object
RE: Object Reference not set to an instance of an object
Put a break on the line, and then set up a watch on ConfigurationManager, ConfigurationManager.ConnectionStrings("ABMSOPConnString"), and ConfigurationManager.ConnectionStrings("ABMSOPConnString").ConnectionString. This should tell you which part is null. I'll wager that ConfigurationManager.ConnectionStrings("ABMSOPConnString").ConnectionString is returning null, and that's why you're getting this error.
I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
RE: Object Reference not set to an instance of an object
Skip,
Just traded in my OLD subtlety...
for a NUance!