Connecting C# to SQL Server Compact database

前端 未结 4 1914
暖寄归人
暖寄归人 2021-01-19 00:11

Hi I\'m trying to connect an SQL server compact database to my program and I want a button that deletes all entries from the database, when I Press said button the program t

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-19 01:00

    Have a look at this blog article: SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    This goes step-by-step through what you might need to do:

    In short:

    1. SQL Server should be up and running.
    2. Enable TCP/IP in SQL Server Configuration
    3. Open Port in Windows Firewall
    4. Enable Remote Connection
    5. Enable SQL Server Browser Service
    6. Create exception of sqlbrowser.exe in Firewall
    7. Recreate Alias

    About the where and what to do in each step, you will find more in-depth information in the article.

    You may also want to have a look at the Connection strings for SQL Server Compact. There you can find other variations of the connection string you could try to play with.

提交回复
热议问题