Little problem with connection between SQLserver and C#
-
03 Nisan 2012 Salı 02:35
I'm trying to connect an application in WPF with a Database and when I select the database I want this message is shown:
[filename].mdf is currently in use. Write a new name or close the other program that's using the file.
The problem is that I don't have any other program using the DB at that time.
Can anyone tell me why is this happening? Thanks in advance
- Taşıyan Janet YeildingMicrosoft Employee 03 Nisan 2012 Salı 16:27 (From:SQL Server Data Tools)
- Taşıyan Bob BeaucheminMVP 03 Nisan 2012 Salı 18:51 Moved to the appropriate forum for SqlClient questions. (From:.NET Framework inside SQL Server)
Tüm Yanıtlar
-
03 Nisan 2012 Salı 05:10
Hello,
You try to start the MDF file as a "user instance" of SQL Server, but the database seems to be already attached to SQL Server, therefore it's in use and you get that error.
Change your connection string to connect to SQL Server, see http://www.connectionstrings.com/sql-server-2008
Olaf Helper
* cogito ergo sum * errare humanum est * quote erat demonstrandum *
Wenn ich denke, ist das ein Fehler und das beweise ich täglich
Blog Xing- Yanıt Olarak Öneren Janet YeildingMicrosoft Employee 03 Nisan 2012 Salı 16:26
- Yanıt Olarak İşaretleyen Allen Li - AI3Microsoft Contingent Staff, Moderator 05 Nisan 2012 Perşembe 02:21