Problem in Hosting a website on SQL Express Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jaydeep Ramavat
    New Member
    • Jul 2009
    • 12

    Problem in Hosting a website on SQL Express Database

    Dear friends,

    I have hosted the website on the sqlexpress database, but on database operation getting following error.

    "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

    My connectionstrin g is as belows.

    string path = HttpContext.Cur rent.Server.Map Path("App_Data" );
    path = path + "\\";


    string ConnectionStrin g = @"Server=<serve r name>;Data Source=.\SQLEXP RESS;AttachDbFi lename=" + path + "Database.mdf;I ntegrated Security=True;U ser Instance=True";


    Thanks and Regards
    Jaydeep.
  • gagandeepgupta16
    New Member
    • Feb 2007
    • 56

    #2
    Originally posted by Jaydeep Ramavat
    Dear friends,

    I have hosted the website on the sqlexpress database, but on database operation getting following error.

    "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

    My connectionstrin g is as belows.

    string path = HttpContext.Cur rent.Server.Map Path("App_Data" );
    path = path + "\\";


    string ConnectionStrin g = @"Server=<serve r name>;Data Source=.\SQLEXP RESS;AttachDbFi lename=" + path + "Database.mdf;I ntegrated Security=True;U ser Instance=True";


    Thanks and Regards
    Jaydeep.
    Hi

    The <server name> is the SQL Server name or your machine name?

    Check the SQL Server name and if its not the one you have given then replace it.

    Hope this helps you.

    Comment

    Working...