Solved does not connect to Sqlserver2005

Posted on 2007-10-01
Last Modified: 2009-12-16

Using Windows Xp Pro sp2, I installed Microsoft Visual Studio 2005 Pro and Microsoft SQL Server 2005 (not Express).

I started Visual Studio, and created a new Web Site project.
I added a CreateUserWizard component on the Default.aspx page.
I ran the Site.

When I tried to create a user, I got this error (in french)

****************************** Error Begin ***************************************************
Erreur du serveur dans l'application '/myFirstSite'.
Une erreur s'est produite lors de l'établissement d'une connexion au serveur. Lors de la connexion à SQL Server 2005, cet échec peut être dû au fait que les paramètres par défaut de SQL Server n'autorisent pas les connexions à distance. (provider: Interfaces réseau SQL, error: 26 - Erreur lors de la localisation du serveur/de l'instance spécifiés)
Description : Une exception non gérée s'est produite au moment de l'exécution de la demande Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

Erreur lors de la création automatique du fichier de base de données SQLExpress:
****************************** Error End ***************************************************

This is my first experience with these Microsoft products. So please how to get this to work?

Thank you
Question by:rthriller
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    you have to enable remote connections in sql server 2005:
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    LVL 1

    Author Comment


    I tried those, and others from this post

    and when I tried aspnet_regsql I got this error

    SQL Server :
    Base de données : [aspnetdb]
    Fichier SQL chargé :

    Échec des commandes :

    CREATE TABLE #aspnet_Permissions
        Owner     sysname,
        Object    sysname,
        Grantee   sysname,
        Grantor   sysname,
        ProtectType char(10),
        [Action]    varchar(20),
        [Column]    sysname

    INSERT INTO #aspnet_Permissions
    EXEC sp_helprotect

                  FROM sysobjects
                 WHERE (name = N'aspnet_Setup_RestorePermissions')
                   AND (type = 'P')))
    DROP PROCEDURE [dbo].aspnet_Setup_RestorePermissions

    Exception SQL :
    System.Data.SqlClient.SqlException: Expiration du délai d'attente. Le délai d'attente s'est écoulé avant la fin de l'opération ou le serveur ne répond pas.
       à System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       à System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       à System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       à System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       à System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       à System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       à System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       à System.Web.Management.SqlServices.ExecuteFile(String file, String server, String database, String dbFileName, SqlConnection connection, Boolean sessionState, Boolean isInstall, SessionStateType sessionStatetype)
    LVL 1

    Accepted Solution

    The problem was a spelling error in the connection string
    I used this
                <remove name="LocalSqlServer"/>
                <add name="LocalSqlServer" connectionString="data source=.;Integrated Seurity=SSPI;InitialCatalog=aspnetdb" providerName="System.Data.SqlClient"/>

    Integrated Seurity instead if Integrated Security
    InitialCatalog instead of Initial Catalog

    That's it
    LVL 1

    Expert Comment

    Closed, 250 points refunded.
    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now