Profile Object Issue

S

Steve Harclerode

I just tried to use the Profile Object for the first time. I created a new
website, added the below items to the web.config, and then tried to set the
property in C# code.

Intellisense works, and everything compiles, but I'm getting the error that
is also below. I don't have SQL Server 2005 installed on this box, so I
don't know why it would be trying to connect to that...I do have SQL Server
2000 installed.

I'm using ASP.Net 2.0, and Visual Studio 2005.

Here's the top level exceptions and the 2 inner exceptions:
1) Unable to connect to SQL Server database.
2) Unable to connect to SQL Server database.
3) An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the fact
that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error Locating
Server/Instance Specified)

Here's the entire contents of my web.config:
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
<anonymousIdentification enabled="true"/>
<profile>
<properties>
<add name="MyNewProperty" allowAnonymous="true" type="int"/>
</properties>
</profile>
</system.web>
</configuration>
 
M

Mudassar Hassan

You does not have included connection string in your web.config

Please replace your web.config with this one

<configuration>
<appSettings/>
<connectionStrings>
<add name="DSN" connectionString="Server=yoursqlservername;
Database=yourdatabasename; uid=yourusername; pwd=yourpassword;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
<anonymousIdentification enabled="true"/>
<profile>
<properties>
<add name="MyNewProperty" allowAnonymous="true" type="int"/>
</properties>
</profile>
</system.web>
</configuration>


Regards,
Mudassar Hassan
http://mudassarhassan.spaces.live.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top