473,383 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

SQLExpress

I am trying to write an application for a MSSQL database, using SQL Express,
and Visual Studio (Express edition)

I tried to connect to an existing database (named testing) but to no avail.
Visual Studio claims the database does not exist.

Any ideas?
TIA

--
Q: What is the difference between a mathematician and a philosopher?
A: The mathematician only needs paper, pencil, and a trash bin for his
work - the philosopher can do without the trash bin...

May 25 '07 #1
3 3937
Shane wrote:
I am trying to write an application for a MSSQL database, using SQL
Express, and Visual Studio (Express edition)

I tried to connect to an existing database (named testing) but to no
avail. Visual Studio claims the database does not exist.

Any ideas?
TIA
Sorry about that, a simple search turned it up. New problem however, when I
go to connect to it I get the following error.

Unable to open the physical file "C:\Program Files\Micrososft SQL
Server\MSSQL.1\MSSQL\Data\testing.mdf", Operating System error 32: "32(The
process cannot be access the file because it is being used by another
process.)".
An attempt to attach an auto-named database for file C:\Program
Files\Micrososft SQL Server\MSSQL.1\MSSQL\Data\testing.mdf failed. A
database with the same name exists, or specified file cannot be opened, or
it is located on UNC share.
--
It is only two weeks into the term that, in a calculus class, a student
raises his hand and asks: "Will we ever need this stuff in real life?"
The professor gently smiles at him and says: "Of course not - if your real
life will consist of flipping hamburgers at MacDonald's!"

May 25 '07 #2
Shane (sh***@weasel.is-a-geek.net) writes:
>I am trying to write an application for a MSSQL database, using SQL
Express, and Visual Studio (Express edition)

I tried to connect to an existing database (named testing) but to no
avail. Visual Studio claims the database does not exist.

Sorry about that, a simple search turned it up. New problem however,
when I go to connect to it I get the following error.

Unable to open the physical file "C:\Program Files\Micrososft SQL
Server\MSSQL.1\MSSQL\Data\testing.mdf", Operating System error 32: "32(The
process cannot be access the file because it is being used by another
process.)".
An attempt to attach an auto-named database for file C:\Program
Files\Micrososft SQL Server\MSSQL.1\MSSQL\Data\testing.mdf failed. A
database with the same name exists, or specified file cannot be opened, or
it is located on UNC share.
The error message indicates that the file is already open, presumably
by an SQL Server instance.

One possibility is that you have installed several instances of SQL Server
on your machine, not only an Express instance, and this database actually
belongs to some other instance.

But it could also be that you have created this database previously
from Mgmt Studio Express or similar and your Express instance is running.
But SQL Express has this feature User Instance, which does not exist in
any other SQL Server edition. A user instance is cloned off from the main
Express instance. It could be that Visual Studio starts up a user
instance, and then you cannot attach the database to the user instance,
if it's already attached to the main instance.

You may be better off asking a in newsgroup devoted to Visual Studio,
since this depends on what Visual Studio is doing behind the covers.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 26 '07 #3
its depend upon ur connection string which u r using
there are 2 or 3 type of connection string
1 for ur local server
2 for ur SQL server on ur intranet or server
search them on ur local help msdn

May 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lbolognini | last post by:
Hi all, I've got a PostgreSQL schema, how can I import it in SqlExpress? What's the best tool for administering Sql Express. Thanks, Lorenzo
1
by: Borek | last post by:
Hello, I am getting the beforementioned error when trying to populate DataSet object with data taken from SQL2k database. Then I want to bind DataSet to GridView control. But when I use...
3
by: andrewcw | last post by:
I am trying to use the NorthWind database or anything with SQLEXPRESS on VS 2005 RC. I can see SQLExpress started with the tool SQL Server Configuration Manager. But when i select DataBase | New...
2
by: Crash | last post by:
Windows XP MS SQLExpress VS 2003 ..NET 1.x SP1 {for Application} ..NET 2.0 {for SQLExpress} MS Enterprise Library June 2005 This works from a command prompt osql -E -S localhost\SQLEXPRESS
13
by: Matt Fielder | last post by:
First off, if this is better posted in another group that qualifies as a manged group, please let me know. I currently have an application written in VB.Net using MSDE as the database. Current...
4
by: Torben Laursen | last post by:
Hi I am trying to find find the sqlserver express that is running on my computer using: DataTable dtSQLServers = SmoApplication.EnumAvailableSqlServers(false); It returns one row that holds...
2
by: =?Utf-8?B?Q2hhcmxpZQ==?= | last post by:
Hi, I am using System.Diagnostics,Process.Start to execute sqlcmd.exe the second parameter of the Start method is the arguements to pass to sqlcmd Because I am using SQLExpress the string...
2
by: Michel Vanderbeke | last post by:
Hello, I have a program, running in several places, using SQLEXPRESS as database. The different places are stand-alone, and not connected to a network. Regulary, I have to apply changes on...
5
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi, I wonder if someone could shed some light on this one for me. I have developed a web app in VS2005 with the built in server. It uses an sql database, everytihng works. I need to test it...
1
by: Aykut Canturk | last post by:
Can I use SqlExpress2005 AttachDatabase feature with classic ADO connections in my .asp pages ? But I need ConnectionString. Although I searched the web for couple of weeks I still coulnd't find...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.