Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Reference not set to an instance of an object 1

Status
Not open for further replies.

Halliarse

IS-IT--Management
Jan 8, 2007
213
GB
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
 


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!
 
I did indeed Jebenson....that's what is more than a little confusing!
 
The only other thing I can think of is that you don't actually have a connection string named ABMSOPConnString in your configuration file.

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!
 
I'd step through a loop of the connections collection, to observe the Name of each

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top