Hi
I'm trying to use a connection string saved in the web.config, but i'm getting an error
If i copy the ACTUAL connection string in, it works fine. Obviously i dont wish to do this as that would be besides the point of the web.config.
Can anybody spot whats wrong please?
Thanks
I'm trying to use a connection string saved in the web.config, but i'm getting an error
Visual Basic:
Dim conn As New SqlConnection("ConnectionStrings:connCReq.ProviderName")
Visual Basic:
<connectionStrings>
<add name="connCReq" connectionString="Data Source=RA\SQLExpress;Initial Catalog=CReq;User ID=ASP;Password=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
If i copy the ACTUAL connection string in, it works fine. Obviously i dont wish to do this as that would be besides the point of the web.config.
Can anybody spot whats wrong please?
Thanks