Profiles problem

Discussion in 'ASP .Net' started by Rafa, May 30, 2007.

  1. Rafa

    Rafa Guest

    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.Applications.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.Controls.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)."
    Rafa, May 30, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alexandr Zverev

    User Profiles and ASP 2.0

    Alexandr Zverev, Aug 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,206
    Brock Allen
    Aug 2, 2005
  2. Replies:
    0
    Views:
    496
  3. =?Utf-8?B?Um9ja3k=?=

    Delete User Profiles via ASP.net webform using VB.net

    =?Utf-8?B?Um9ja3k=?=, Jan 19, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    447
    =?Utf-8?B?Um9ja3k=?=
    Jan 19, 2006
  4. VDevelopment

    Profiles in ASP.NET 2.0

    VDevelopment, Jan 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    357
    VDevelopment
    Jan 28, 2006
  5. Jaimie

    Newbie problem with Profiles

    Jaimie, Jun 26, 2006, in forum: .NET
    Replies:
    0
    Views:
    401
    Jaimie
    Jun 26, 2006
Loading...

Share This Page