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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.Net Configuration

Status
Not open for further replies.

viper1777

Programmer
Dec 3, 2003
21
GB
Hi,

I am a relative newbie to ASP.NET 2.0. I have created a web site (ClimbYorkshire.com - Still under development) and I was wanting to add Forms Authentication to the site.

I have watched a couple of webcasts from MS and they tell me to use the ASP.NET Configuration and then click on the Security Tab. Whenever I do this though I wont connect to the remote SQL Server that I will be using.

I have ran aspnet_regsql as advised but this does not help.

Does anyone have any experience in setting up security on a remote SQL Server?

I am using Visual Web Dev EE.


Thanx!

Dave Shaw
Nothing is Impossible, it is just something I haven't got round to doing. - Me
History admires the wise, but elevates the brave. - Edmund Morris
 
The ASP.NET configuration is a help-tool that prevents you from writing in the web.config. In that file under the connectionstring xml tag, there should be your connection string(s). Have a search on the web on how to encrypt it. The encryption is actually needed for two reasons: 1.passwords and 2.database path.
 
Hi, I have sorted this by adding a custom membership provider to the web.config file.

Can any please elaborate on TipGiver's comments about encrypting the connection string in web.config.

I have google many resourses on this, but these are all for programmatically decrypting the connection string. how do I tell me Membership provider to use my encrypted connection string?

Thanx!

Dave Shaw
Nothing is Impossible, it is just something I haven't got round to doing. - Me
History admires the wise, but elevates the brave. - Edmund Morris
 
Can I elaborate ? lol


Code:
    Imports System.Web.Configuration

Code:
    Protected Sub EncryptButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles EncryptButton.Click

        ' open the web.config file
        Dim config As Configuration = WebConfigurationManager. _
            OpenWebConfiguration(Request.ApplicationPath)

        ' indicate the section to protect
        Dim section As ConfigurationSection = config.Sections("connectionStrings")

        ' specify the protection provider
        section.SectionInformation.ProtectSection("RSAProtectedConfigurationProvider")

        ' Apply the protection and update
        config.Save()

    End Sub
 
Hmm, i forgot:

Code:
    If section.SectionInformation.IsProtected Then
        ' UNprotect it
    Else
        ' Protect it
    End If


Regards!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top