E
elziko
I am trying to create a conneciton to an SQL Server Express database from
..NET. Here is my connection string:
'Data Source=.\SQLEXPRESS;AttachDbFilename="c:\database.mdf";Integrated
Security=True;Connect Timeout=30;User Instance=True'
However, I get the following error:
'An attempt to attach an auto-named database for file c:\database.mdf
failed. A database with the same name exists, or specified file cannot be
opened, or it is located on UNC share.'
I then used SSEUtil to list all attached databases and it was not there, and
I also tried to detach it anyway but I was told that 'No valid database path
matches teh value specified.' and rightly so.
But then I tried to attach the database from within SSEUtil and it quite
happily attached the database just fine. Surely if I can't attach using
ADO.NET that why can I attach using SSEUtil?
Any ideas?
TIA
..NET. Here is my connection string:
'Data Source=.\SQLEXPRESS;AttachDbFilename="c:\database.mdf";Integrated
Security=True;Connect Timeout=30;User Instance=True'
However, I get the following error:
'An attempt to attach an auto-named database for file c:\database.mdf
failed. A database with the same name exists, or specified file cannot be
opened, or it is located on UNC share.'
I then used SSEUtil to list all attached databases and it was not there, and
I also tried to detach it anyway but I was told that 'No valid database path
matches teh value specified.' and rightly so.
But then I tried to attach the database from within SSEUtil and it quite
happily attached the database just fine. Surely if I can't attach using
ADO.NET that why can I attach using SSEUtil?
Any ideas?
TIA