Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Profiles problem

Reply
Thread Tools

Profiles problem

 
 
Rafa
Guest
Posts: n/a
 
      05-30-2007
Hello,

First, sorry because I am spanish and my english are not good.

My problem is that i am trying to work with profiles in visual studio 2005,
but i have an error.
the error is that:

"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)."

My web aplication work correctly in the database access, but i use an class
library to get the conecctionString, not use the connectionString from
web.config.

The code of the web.config is:
--*******************-----------
<connectionStrings>
<add name="MainConnStr" connectionString="data source=BAMP-SRV-02;initial
catalog=EJEMPLO_CULTURAS;password=sa;persist security info=True;user id=sa"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<anonymousIdentification enabled="true"/>
<profile>
<providers>
<remove name="SqlProvider" />
<add
name="SqlProvider"
connectionStringName="MainConnStr"
applicationName="EjemploCulturasASP"
type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add name="LanguagePreference" type="System.String"
defaultValue="Auto" allowAnonymous="true" />
<add name="Age" type="System.Int32"
defaultValue="0" allowAnonymous="true" />
<add name="Gender" type="System.String"
defaultValue="" allowAnonymous="true" />
<add name="Country" type="System.String"
defaultValue="Auto" allowAnonymous="true" />
</properties>
</profile>

<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="Microsoft.Office.Tools.Excel, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.Office.Tools.Word, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
<add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
<add assembly="office, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71E9BCE111E9429C"/>
<add assembly="Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71E9BCE111E9429C"/>
<add assembly="Microsoft.Office.Interop.Word, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
<add assembly="Microsoft.Office.Tools.Common, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="VSTOStorageWrapper.Interop, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="stdole, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.VisualStudio.Tools.Application s.Runtime,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.Office.Interop.SmartTag, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
<add
assembly="Microsoft.VisualStudio.OfficeTools.Contr ols.ManagedWrapper,
Version=8.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>

-******************------



And I am trying to make an generic class for the aplication pages:

-**************-
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Globalization;
using System.Threading;
using System.Web.Profile;


public class PageHereda: System.Web.UI.Page
{
protected override void InitializeCulture()
{
base.InitializeCulture();


ProfileCommon perfil = (ProfileCommon)Context.Profile;
string languagePreference = perfil.LanguagePreference.ToString();

}
}

-*****************-

When I try to access to perfil.LanguagePreference give me the error:
"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)."


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem getting rid of printer colour profiles. Eric Stevens Digital Photography 5 04-04-2010 01:33 AM
Still got Tbird profiles problem. davy Firefox 0 01-24-2010 11:48 AM
Newbie problem with Profiles Jaimie ASP .Net 0 06-25-2006 11:38 PM
Moz1.7.5. Multiple profiles, profiles lacking email accts crash. oops Splibbilla Firefox 0 03-21-2005 02:58 AM
yahoo profiles - server problem cc Computer Support 2 12-18-2003 03:48 AM



Advertisments