View Full Version : How do I make myhosting sql server my default provider?
2008-11-15, 11:18 AM
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"
<add connectionString="Server=sqlhosting02.myhosting.com;Database=User_xx ;User ID=User_xxxxx;Password=xxx" name="xxxx" providerName="System.Data.SqlClient" />
<add name="LocalSqlServer" type="System.Web.Security.SqlMembershipProvider" connectionStringName="XXXXXXX" enablePasswordReset="true" enablePasswordRetrieval="true" passwordFormat="Encrypted" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" />
2008-11-18, 01:27 PM
this forum is dead isn't it? :cry:
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?
<add connectionString="Server=sqlhosting02.myhosting.com;Database=DB_xxxx x;User ID=User_xxxxx;Password=xxx" name="xxxx" providerName="System.Data.SqlClient" />
2008-11-18, 03:54 PM
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)."
Here are some further suggestions:
I do not recognize the System.Web.Security.SqlMembershipProvider information. Try using the following in the web.config file.
<add key="MyConnectionString" value="Persist Security Info=True;User ID=User_xxxx;Password=*********;Initial Catalog=DB_xxxx;Data Source=sqlhosting02.myhosting.com "/>
Then use it the following way.
Dim myConnection As System.Data.SqlClient.SqlConnection
myConnection = New System.Data.SqlClient.SqlConnection(ConfigurationM anager.AppSettings("MyConnectionString "))
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()
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:
<add name="MyConnectionString" connectionString="Persist Security Info=True;User ID=User_xxxx;Password=*********;Initial Catalog=DB_xxxx;Data Source=sqlhosting02.myhosting.com" />
Hope this helps.
2008-11-18, 04:41 PM
this is what I'm doing with the provider..
<add name="LocalSqlServer" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" />
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.
I am getting the same error.... Microsoft says this...
http://www.iis.net/ConfigReference/syst ... viders/add (http://www.iis.net/ConfigReference/system.webServer/management/trustedProviders/add)
However, looking at the support site- it seems that this feature is not actually supported the way IIS7 intended...
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:
System.Web, Version=2.0.3600.0, Culture=neutral,
You would need to check what all the information you need to get it to work with the MySQLMembershipProvider
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.