Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database in use

Author  Topic 

harrytu386
Starting Member

3 Posts

Posted - 2014-01-11 : 19:09:59
I am not new to SQL but couldn't find a place to ask this. If it needs to go somewhere please let me know.

I have an SQL server 2008 R2 database. I am trying to add it as a data source to a VS 2010 professional project. When I select the database I get a "database in use" error.

I have rebooted the system and tried this as the very first thing I do and still get the "database in use" error.

Can somebody help?

Thanks


Harry T Ulmer

Mar
Starting Member

47 Posts

Posted - 2014-01-14 : 07:49:34
Can you tell us how you are adding this data source?
We can't help if we don't know what you are doing. This means describe the steps, all of them.

Also you know that you do not need to add a data source to get at the data right?
Go to Top of Page

harrytu386
Starting Member

3 Posts

Posted - 2014-01-14 : 08:29:56
First I create a ne1w database MyReports and add tables and s`
1) From the project Data menu I select Add New Data Source
2) Select Database as the Data Source Type
3) Select DataSet as the Database Model
4) Click New connection
5) Change the Data Source to Microsoft SQL Database File
6) Forhe database name:
Select Browse and go to c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA
7) Select MyReport.mdf

Get: MyReport.mdf
File is in use.

Harry T Ulmer
Go to Top of Page

harrytu386
Starting Member

3 Posts

Posted - 2014-01-14 : 08:34:42
I am using LINQ statements to access the database via stored procedures.
How does this work without having a Data Source?

Harry T Ulmer
Go to Top of Page

Mar
Starting Member

47 Posts

Posted - 2014-01-14 : 15:16:14
I don't think I can be of much help to you. I tried to follow your steps but couldn't. It seems the adding a data source proceudre has changed from 2008 to 2010.

You can try changing your authentication to see if that helps.

You should have a test connection button, try that.

I execute stored procedures via ADO.Net. I also don't use LINQ, I use SQL.

I prefer writing code direct that using all the extra layers, so sorry, I don't think I would be of much help.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2014-01-15 : 01:44:45
have you looked at DSN-less connection strings?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -