You must Sign In to post a response.
  • Category: Visual Studio

    How to solve error while attaching service based database?

    hey friends i got error while attching service based database to my windows application as well as when i trying to attach local database it attached succsessfully but sql connection closes when i build project. i really dont know how to solve this issue. i did go through all possible solutions on web but not worked , suggest me any possible way.

    i attached one word document where image of error shown plz do look to that.
  • #758506
    Hey here is error dox


    Delete Attachment

  • #758508
    Hello Priyanka,

    Just follow the below steps:
    Open Microsoft Visual Studio
    Select Tools >> Options >> Database Tools >> Data Connections
    Enter the name of an installed instance in "SQL Server Instance Name" field.
    Click OK

    Still if you are getting an error let me know.

    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."

  • #758509
    it by default gets Install instance name i.e. MSSQLEXPRESS

  • #758513
    Hello Priyanka,

    Replace the SQL Server Instance name with SQLEXPRESS than click ok and refresh the server and try to create or open existing database.

    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."

  • #758515
    both not worked sir it sends again error "Failed to generate user instance of sql server due to failure in starting process of user instance . the connection is closed"

  • #758517
    when i add mdf file to project by stoping all services it added and seen in solution explorer but again showing error ""a network 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)""

  • #758518
    Hi Priyanka,

    Just follow the below steps. This will surely help you if you have installed SQL Server correctly:
    1) First Step check your SQL services are running fine.
    2) Click on "Start Window" and expand "Microsoft SQL Server 2008 R2" and click on "SQL Server Configuration Manager".
    3) Now click on left pane "SQL Server Services" and check for "SQL Server (SQLEXPRESS)" running or not, if it is in green color then it's working fine.
    4) Now check for "SQL Server (MSSQLSERVER)", it should be in green color means running fine.
    5) Now check for "SQL Server Browser" running or not, you have to make sure is green marked.
    6) Now click on "Aliases" left pane, make assure on right pane that there should be empty aliases, if requires then should recreate from fresh.
    7) Now check for SQL Server Default Portal 1433, if you have not already added then follow to open "Ctrl + R", type "Firewall.cpl" then Firewall will open and Click on "Advanced Settings".
    8) Click on "Inbound Rules" in left pane and click on right pane "New Rule".
    9) Then Click on "Protocol and Ports" and click on "Specific local ports" and write SQL default Port No "1433".
    10) Now write name on SQL Port Name and click on "Finish" button.
    11) Now click on "Client Protocols" in left pane, next click on right pane "TCP/IP" and click on "Property" then you check that your default Port "1433" has been populated.
    12) Now Open "SQL Server Management Studio" and right click, now property window open and click on "Property".
    13) Now click on "Connections" option and Check option "Allow remote connections to this server" and click now on "OK".
    14) You have to Ping for your IP Host Address on your command prompt "cmd" console.
    15) Check for Firewall blocking SQL Server Port 1433
    16) If you have already access to development machine, production server then it will be helpful greatly. Press (Windows + R) to open Run window to launch program quickly. Now type "EVENTVWR" and a new window will open, now expand left pane, you can check here "Windows Log" to look into issue very closely and specifically.
    17) We can use also Netstat Command to display how communicating with other computers or networks.
    Command: netstat [-a] [-b] [-e] [-f] [-n] [-o] [-p protocol] [-r] [-s] [-t] [-x] [-y] [time_interval] [/?]

    Mark the answer if it helps you.

    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."

  • #758523
    i did full settings still not worked

  • Sign In to post your comments