Database is being used by another process … but what process?

后端 未结 10 1620

I have written a very small C# program, that uses a very small SQL Server database, purely for some learning & testing purposes. The database is used in this one new pro

10条回答
  •  时光说笑
    2021-01-06 00:35

    The most likely options:

    1. A previous (crashed) instance of your program
    2. Visual Studio (with a Table designer open or something similar)

    You can check 1) with TaskManager and 2) by looking in Server Explorer. Your db should show a small red cross meaning 'closed'.

    And you should rewrite your code to close connections ASAP. Use try/finally or using(){ } blocks.

提交回复
热议问题