Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    kinane3 is offline Junior Member
    Join Date
    Sep 2008
    Posts
    5

    Default How do I make myhosting sql server my default provider?

    I am trying to setup my myhosting sql server as my default provider. what am I doing wrong? I keep getting this as an error.

    "This configured users could not be displayed because the default provider is not a trusted provider"

    <connectionStrings>
    <clear />
    <add connectionString="Server=sqlhosting02.myhosting.co m;Database=User_xx;User ID=User_xxxxx;Password=xxx" name="xxxx" providerName="System.Data.SqlClient" />
    </connectionStrings>

    <membership defaultProvider="LocalSqlServer">
    <providers>
    <clear />
    <add name="LocalSqlServer" type="System.Web.Security.SqlMembershipProvider" connectionStringName="XXXXXXX" enablePasswordReset="true" enablePasswordRetrieval="true" passwordFormat="Encrypted" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" />
    </providers>
    </membership>

    thanks!!

  2. #2
    kinane3 is offline Junior Member
    Join Date
    Sep 2008
    Posts
    5

    Default Re: How do I make myhosting sql server my default provider?

    this forum is dead isn't it? :cry:

  3. #3
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default Re: How do I make myhosting sql server my default provider?

    Sorry for the delay in responding! We noticed that in your connection string you have Database=User_xx, but it should be Database=DB_xx. Can you double-check your connection string to make sure it looks like this?

    Quote Originally Posted by kinane3
    <connectionStrings>
    <clear />
    <add connectionString="Server=sqlhosting02.myhosting.co m;Database=DB_xxxxx;User ID=User_xxxxx;Password=xxx" name="xxxx" providerName="System.Data.SqlClient" />
    </connectionStrings>
    Tim Attwood
    Product Manager
    myhosting.com

  4. #4
    kinane3 is offline Junior Member
    Join Date
    Sep 2008
    Posts
    5

    Default Re: How do I make myhosting sql server my default provider?

    I did notice that too and fixed it. I'm making a connection now...however, when using the IIS7 manager I still get this error when viewing the .Net Users utility. the error reads...

    "this feature cannot be used because the default provider type could not be determined to check whether it is a trusted provider. You can use this feature only when the default provider is a trusted provider. If you are a server administrator, you can make a provider by adding the provider type to the trusted providers list in the Administration.config file. The provider had to be strongly typed and added to the GAC (Global Assembly Cache)."

  5. #5
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default Re: How do I make myhosting sql server my default provider?

    Here are some further suggestions:
    I do not recognize the System.Web.Security.SqlMembershipProvider information. Try using the following in the web.config file.

    Code:
    <configuration>
                    <appSettings>
                                    <add key="MyConnectionString" value="Persist Security Info=True;User ID=User_xxxx;Password=*********;Initial Catalog=DB_xxxx;Data Source=sqlhosting02.myhosting.com "/>
                    </appSettings>
    <connectionStrings>
    Then use it the following way.

    Code:
    Dim myConnection As System.Data.SqlClient.SqlConnection
    myConnection = New System.Data.SqlClient.SqlConnection(ConfigurationManager.AppSettings("MyConnectionString "))
    myConnection.Open()
    
    Dim MySqlCommand As New System.Data.SqlClient.SqlCommand
    MySqlCommand.Connection = myConnection
    MySqlCommand.CommandType = System.Data.CommandType.Text 
    MySqlCommand.CommandText = "SELECT * FROM MyTable"
    
    Dim MyReader As System.Data.SqlClient.SqlDataReader
    MyReader = MySqlCommand.ExecuteReader()
    
    Do While MyReader.Read()
                    Response.Write(MyReader.Item("MyColumn"))
    Loop
    
    MyReader.Close()
    Tim Attwood
    Product Manager
    myhosting.com

  6. #6
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default Re: How do I make myhosting sql server my default provider?

    Also, here is some suggested further reading: http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

    LocalSqlServer points to the ASPNETDB database in the App_Data folder. You will need to use CustomizedProvider. The web.config will look like this:

    Code:
    <configuration>
      <connectionStrings>
         <add name="MyConnectionString" connectionString="Persist Security Info=True;User ID=User_xxxx;Password=*********;Initial Catalog=DB_xxxx;Data Source=sqlhosting02.myhosting.com" />
      </connectionStrings>
      <system.web>
    
        <membership defaultProvider="CustomizedProvider">
          <providers>
             <add name="CustomizedProvider"
                  type="System.Web.Security.SqlMembershipProvider"  
                  connectionStringName="MyConnectionString"
                  applicationName="MyApplication"
                  enablePasswordReset="true"
                  enablePasswordRetrieval="true"
                  passwordFormat="Encrypted"
                  requiresQuestionAndAnswer="true"
                  requiresUniqueEmail="true"
          </providers>
        </membership>
      </system.web>
    </configuration>
    Hope this helps.
    Tim Attwood
    Product Manager
    myhosting.com

  7. #7
    kinane3 is offline Junior Member
    Join Date
    Sep 2008
    Posts
    5

    Default Re: How do I make myhosting sql server my default provider?

    this is what I'm doing with the provider..

    Code:
    <membership defaultProvider="LocalSqlServer">
                <providers>
                    <clear />
                    <add name="LocalSqlServer" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" />
                </providers>
            </membership>
    it seems to be working, I can create a user successfully with my full version myhosting sql server. the error I'm referring to it coming from the IIS7 manager itself. at the moment I suppose it isn't cause a functional problem but I'm wondering if it will in the future as I develop further.

    thanks!

  8. #8
    Hal
    Hal is offline Junior Member
    Join Date
    Mar 2009
    Posts
    1

    Default Re: How do I make myhosting sql server my default provider?

    I am getting the same error.... Microsoft says this...

    http://www.iis.net/ConfigReference/syst ... viders/add

    However, looking at the support site- it seems that this feature is not actually supported the way IIS7 intended...

    http://wiki.myhosting.com/ASP.NET_Forms_Authentication

    -- Edit

    So I took a look at the "application" that's provided- and it clearly doesn't use the IIS7.0 ASP_* tables.. it's using a custom XML file. Doesn't look like there's any group support, standard in IIS7's built in forms authentication- also not sure it will actually work to secure non asp.net content, as intended by the IIS 7.0 architecture....

    -- Edit 2

    It seems that the problem here relates to the first IIS.net link provided above. The sites "inherit" 2 user providers = MySQLMembershipProvider and AspNetSqlMembershipProvider. If you want to change properties of these providers at all, it somehow becomes "untrusted", even if the type is System.Web.Security.SqlMembershipProvider

    This is a problem for me- as I do NOT want to require email addresses- or password reminder strings- or anything like that. but it's 'on' with the inherited provider.

    -- Edit 3
    Yes I know- but this might help someone....
    Ok- I fixed this for SQL server- When you create the custom provider you need to put this as the type:

    Code:
    				  type="System.Web.Security.SqlMembershipProvider,
    							System.Web, Version=2.0.3600.0, Culture=neutral,
    							PublicKeyToken=b03f5f7f11d50a3a"
    You would need to check what all the information you need to get it to work with the MySQLMembershipProvider

  9. #9
    tima is offline Administrator
    Join Date
    Apr 2008
    Posts
    191

    Default Re: How do I make myhosting sql server my default provider?

    Hello Hal,

    Seems like you may have found your solution. It's all a bit over my head but if you still need help, reply here and I'll try to find some for you.

    Thanks,
    Tim Attwood
    Product Manager
    myhosting.com


 

Similar Threads

  1. SQL Backup and Restore in support.myhosting.com
    By community-manager in forum Promotions, Sales, Billing
    Replies: 5
    Last Post: 2010-04-07, 11:35 AM
  2. Connect to SQL Server 2008 w/ Mngmt Studio
    By Underated in forum Troubleshooting
    Replies: 6
    Last Post: 2009-05-25, 05:14 PM
  3. Testing SMTP Port? How can I make sure that it is open...
    By konna2008 in forum Troubleshooting
    Replies: 3
    Last Post: 2008-07-04, 12:13 PM
  4. Microsoft® SQL Server™ 2008 Database - Beta is available...
    By community-manager in forum News, Announcements, and Notices
    Replies: 0
    Last Post: 2008-06-18, 11:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts