views:

184

answers:

3

Hi

I've written a little web site in my effort to learn vb.net and asp.net, fairly happy with it so rented some space and uploaded it, it was written using asp.net express edition 2008 and sql server express .... I've uploaded it and I've found that it was written in .NET 3.5 and my host only deals with 2.01 ... I've sorted most of that out, and trimmed my web.config file back to basics, but my forms based authentication isn't working

<compilation debug="true" strict="false" explicit="true">
     </compilation>
     <authentication mode="Forms" />
    <customErrors mode="Off"/>
  </system.web>

And it keeps reporting that the sql server does not support remote access ...... not sure what to do next, I don't have to write my own security routines do i ? I have a sql server back end

Thanks for your time

Chris

+1  A: 

If the probllem is that you can not access your SQL Server it may be that you are using a trusted connection to it?

It is not likely to work if the website is on a ISP network and your SQL Server is on another network.

What you then need to do is take a look at your connectionstring to change it so that you pass along the username/password in the connection string. NB: This is not optimal in terms of security but it is a way to access remot SQL Servers that are in antother domain.

/joakim

Yooakim
Hi ThanksThe connection string being used is not a trusted connection string (contains ip addresss,user name and password) and works for all other pages on the site, just not the asp.net authentication/login controls
spacemonkeys
+1  A: 

Are you using the SqlMembershipProvider to store your users in your database? Check your config file's section and make sure the connectionStringName refers to the name of your connection string.

duckworth
cheers pointed me in the right direction, but now all pages direct to my login page ... which won't let me login ... but at least its a step in the right direction :-)
spacemonkeys
A: 

Cheers for your help people, changed my web.config to

<?xml version="1.0"?>
<configuration>
    <appSettings/>
  <connectionStrings>
    <add name="DatebaseConnectionString" connectionString="ohh wouldn't you like to know" />
  </connectionStrings>
    <system.web>
     <roleManager enabled="true" />
  <compilation debug="true" strict="false" explicit="true">
     </compilation>
    <pages>
      <namespaces>
        <clear/>
        <add namespace="System"/>
        <add namespace="System.Collections"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="System.Collections.Specialized"/>
        <add namespace="System.Configuration"/>
        <add namespace="System.Text"/>
        <add namespace="System.Text.RegularExpressions"/>
        <add namespace="System.Web"/>
        <add namespace="System.Web.Caching"/>
        <add namespace="System.Web.SessionState"/>
        <add namespace="System.Web.Security"/>
        <add namespace="System.Web.Profile"/>
        <add namespace="System.Web.UI"/>
        <add namespace="System.Web.UI.WebControls"/>
        <add namespace="System.Web.UI.WebControls.WebParts"/>
        <add namespace="System.Web.UI.HtmlControls"/>
      </namespaces>
    </pages>
     <authentication mode="Forms" />
    <membership defaultProvider="SqlProvider">
       <providers>
          <add connectionStringName="DatebaseConnectionString" applicationName="pedalpedalpuffpuff.com"
             enablePasswordRetrieval="false" enablePasswordReset="true"
             requiresQuestionAndAnswer="true" requiresUniqueEmail="true"
             passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"
             name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" />
       </providers>
    </membership>
    <customErrors mode="Off"/>
  </system.web>
</configuration>

And all worked fine

spacemonkeys