How-to force Profiles to use SQL Server 2000

  • Thread starter Thread starter Saber
  • Start date Start date
S

Saber

I've not installed SQL Express and want to use SQL Server 2000 instead,
I want to use SQL Server address instead of App_Data folder.
web.config contains:
****************************************************
<anonymousIdentification enabled="true"/>
<profile>
<providers>
<add name="ProfileProvider2"
connectionStringName="admanagementConnectionString1"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add customProviderData="ProfileProvider2" name="UserIdd"
type="System.String" allowAnonymous="true"/>
</properties>
</profile>
*****************************************************
But it still wants to use SQL Express, it is a part of error:

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance
using.....
 
Are you getting the correct Provider? I don't see you using <clear />.

What does this show?

Protected Sub Page_Load _
(ByVal sender As Object, ByVal e As System.EventArgs)
For Each p As Provider.ProviderBase In ProfileManager.Providers
Response.Write(p.Name & ", " & p.GetType().ToString() & "<br
/>")
Response.Write(p.Description & "<br />")
Next
End Sub
 
Thanks Ken,
Here is the result of your code:
AspNetSqlProfileProvider, System.Web.Profile.SqlProfileProvider
SQL profile provider.
ProfileProvider2, System.Web.Profile.SqlProfileProvider
SQL profile provider.
Are you getting the correct Provider? I don't see you using <clear />.
How I do this?
 
You should be able to use the Web Site Administration Tool to change the
default provider. By default, the Web Site Administration Tool uses the
AspNetSqlProvider provider for all application features.


http://msdn2.microsoft.com/en-us/library/83y98ckk.aspx

Here's how to use <clear />

<profile defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="SampleApplication"
description="SqlProfileProvider for SampleApplication" />
</providers>

http://msdn2.microsoft.com/en-us/library/ms164644.aspx

Ken
 
Thanks Ken for your replies,
I fixed it by removing this line in machine.config:
<add name="LocalSqlServer" connectionString="data
source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
Instance=true" providerName="System.Data.SqlClient" />

And adding this line instead:
<add name="LocalSqlServer" connectionString="Data Source=sina;Initial
Catalog=admanagement;Integrated Security=True"
providerName="System.Data.SqlClient" />



Now I'm very happy :~)


Ken Cox - Microsoft MVP said:
You should be able to use the Web Site Administration Tool to change the
default provider. By default, the Web Site Administration Tool uses the
AspNetSqlProvider provider for all application features.


http://msdn2.microsoft.com/en-us/library/83y98ckk.aspx

Here's how to use <clear />

<profile defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="SampleApplication"
description="SqlProfileProvider for SampleApplication" />
</providers>

http://msdn2.microsoft.com/en-us/library/ms164644.aspx

Ken


Saber said:
Thanks Ken,
Here is the result of your code:
AspNetSqlProfileProvider, System.Web.Profile.SqlProfileProvider
SQL profile provider.
ProfileProvider2, System.Web.Profile.SqlProfileProvider
SQL profile provider.
Are you getting the correct Provider? I don't see you using <clear />.
How I do this?

Ken Cox - Microsoft MVP said:
Are you getting the correct Provider? I don't see you using <clear />.

What does this show?

Protected Sub Page_Load _
(ByVal sender As Object, ByVal e As System.EventArgs)
For Each p As Provider.ProviderBase In ProfileManager.Providers
Response.Write(p.Name & ", " & p.GetType().ToString() & "<br
/>")
Response.Write(p.Description & "<br />")
Next
End Sub


"Saber" <saber[.AT.]oxin.ir> wrote in message
I've not installed SQL Express and want to use SQL Server 2000 instead,
I want to use SQL Server address instead of App_Data folder.
web.config contains:
****************************************************
<anonymousIdentification enabled="true"/>
<profile>
<providers>
<add name="ProfileProvider2"
connectionStringName="admanagementConnectionString1"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add customProviderData="ProfileProvider2" name="UserIdd"
type="System.String" allowAnonymous="true"/>
</properties>
</profile>
*****************************************************
But it still wants to use SQL Express, it is a part of error:

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance
using.....
 
Thanks for reporting back!

Saber said:
Thanks Ken for your replies,
I fixed it by removing this line in machine.config:
<add name="LocalSqlServer" connectionString="data
source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User
Instance=true" providerName="System.Data.SqlClient" />

And adding this line instead:
<add name="LocalSqlServer" connectionString="Data Source=sina;Initial
Catalog=admanagement;Integrated Security=True"
providerName="System.Data.SqlClient" />



Now I'm very happy :~)


Ken Cox - Microsoft MVP said:
You should be able to use the Web Site Administration Tool to change the
default provider. By default, the Web Site Administration Tool uses the
AspNetSqlProvider provider for all application features.


http://msdn2.microsoft.com/en-us/library/83y98ckk.aspx

Here's how to use <clear />

<profile defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="SampleApplication"
description="SqlProfileProvider for SampleApplication" />
</providers>

http://msdn2.microsoft.com/en-us/library/ms164644.aspx

Ken


Saber said:
Thanks Ken,
Here is the result of your code:
AspNetSqlProfileProvider, System.Web.Profile.SqlProfileProvider
SQL profile provider.
ProfileProvider2, System.Web.Profile.SqlProfileProvider
SQL profile provider.

Are you getting the correct Provider? I don't see you using <clear />.
How I do this?

Are you getting the correct Provider? I don't see you using <clear />.

What does this show?

Protected Sub Page_Load _
(ByVal sender As Object, ByVal e As System.EventArgs)
For Each p As Provider.ProviderBase In ProfileManager.Providers
Response.Write(p.Name & ", " & p.GetType().ToString() & "<br
/>")
Response.Write(p.Description & "<br />")
Next
End Sub


"Saber" <saber[.AT.]oxin.ir> wrote in message
I've not installed SQL Express and want to use SQL Server 2000
instead,
I want to use SQL Server address instead of App_Data folder.
web.config contains:
****************************************************
<anonymousIdentification enabled="true"/>
<profile>
<providers>
<add name="ProfileProvider2"
connectionStringName="admanagementConnectionString1"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add customProviderData="ProfileProvider2" name="UserIdd"
type="System.String" allowAnonymous="true"/>
</properties>
</profile>
*****************************************************
But it still wants to use SQL Express, it is a part of error:

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance
using.....
 
Back
Top