connection string syntax in page using config file

  • Thread starter D. Shane Fowlkes
  • Start date
D

D. Shane Fowlkes

I'm trying out a whole bunch of new (to me) techniques. Using asp.net 2
(vb), can someone correct my connection syntax. The problem seems to be
that I'm not properly referening the config settings in my aspx page.

Thanks!

Compiler Error Message: BC30456: 'connectionStrings' is not a member of
'Configuration'.

strConnectString = System.configuration.connectionStrings("DRPTWeb")



My web.config file:

<configuration>

<connectionStrings>

<add name="DRPTWeb" connectionString="Data Source=DRPT-DEV01;Initial
Catalog=DRPT....etc....." providerName="System.Data.SqlClient" />

</connectionStrings>
 
C

Christopher Reed

It should be
System.Configuration.ConfigurationManager.ConnectionStrings("DRPTWeb").
 
T

Teemu Keiski

strConnectString =
System.Configuration.ConfigurationManager.ConnectionStrings("DRPTWeb").ConnectionString
 
C

Christopher Reed

I stand corrected. I'm still use the hash functionality of AppSettings from
1.x.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top