SQL Server 2005 Express Instance Naming

Jul 25, 2005

I'm new to SQL Server and just installed VS 2005 and SQL Server 2005 Express. My question is, is there any naming rules for an instance? When I open Express Manager it is asking me to enter an Instance name. Thanks for any suggestions or help,

View 2 Replies


ADVERTISEMENT

Cannot Connect By Naming Instance In Mssql 2005 Cluster

May 9, 2007

Hello,



I install Cluster naming instance of MSSQL 2005 Enterprise edition with SP2 and latest patch.

When I try connecting this instance from outside of the server by "server nameinstance name" I got connection error.

But when I connecting by "server name,port number" it's connecting with no problem.

Can someone help me resolve connection outside of the server with "server nameinstance name"?



Thanks

View 7 Replies View Related

How To Configure SQL Server Management Studio Express To Allow Doing Non-User-Instance/ADO.NET 2.0 From VB 2005 Express?

Mar 5, 2008

Hi all,

For the first time, I want to set up the configuration of my SQL Server Management Studio Express (SSMSE) to allow me in doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express. The SSMSE and VB 2005 Express are in my Windows XP Pro PC that is part of our NT 4 LAN System in our office. I read the article "How to configure SQL Server 2005 to allow remotre connections" in http://support.microsoft.com/kb/914277/ about (i) "Enable remote connections for SQL Server 2005 Express", (ii) Enable the SQL Server Browser service", (iii) Create exception in Windows Firewall, and (iv) Create an exception for the SQL Server Browser service in Windows Firewall. I entered the SQL Server Surface Area Configuration and I could not decide what options I should take for doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express. I have the following questions on the page of "Minimize SQL Server 2005 Surface Area":
(1) I saw "Configure Surface Area for localhost [change computer]". I clicked on [change computer] and I saw the
following: Select Computer
The Surface Area Configuration of this surface area of this computer or a remote computer.
Specify a computer to configure: O Local computer
O Remote computer
Should I choose the "Local computer" or the "Remote computer" option?
(2) Below the "Configure Surface Area for localhost [change computer]",
I clicked on "Surface Area Configuration for Service and Connections", Select a component and then configure its services and connections: |-| SQLEXPRESS
|-| Database Engine
Service
I picked => Remote Connection
On the right-hand side, there are: O Local connections only
O Local and remorte connections
O Using TCP/IP
O Using named pipes only
O Using both TCP/IP and named pipes
Should I choose O Local and remorte connections and O Using named pipes only?

Please help and tell me what options I should choose in (1) and (2).

Thanks in advance,
Scott Chang

View 10 Replies View Related

SQL 2005 Server Express - Instance Restrictions?

Nov 21, 2006

Hi,

Do the restrictions for SQL 2005 express apply to each instance or per server? For example, if there are two instances installed on a dual CPU machine, can each instance be configured to use 1 CPU and 1 GB of RAM?

Thank you.





View 1 Replies View Related

SQL Server Express 2005 Creating A User Instance

Mar 23, 2006

How do you create a user instance so that you dont have to be logged on as administrator?

View 5 Replies View Related

SQL Server 2005 Express User Instance Madness

Aug 31, 2007

Hello, I'll try to make the description of this multi-problem scenario as short and sweet as possible.

First Problem
The default named instance of "SQLEXPRESS" was somehow installed on my machine and nothing can get rid of it. However, it is somehow invisible to everything else on my system, so I can't use it. How do I get rid of the instance or repair it?

Second problem
I installed another instance of the SQL Server 2005 Express and named it, "SQLEXPRESS02". I attached a database to it and successfully retrieved data from it using an application that used the following connection string:


Data Source=(local)sqlexpress02;AttachDbFilename=|DataDirectory|MyDatabase.mdf;Initial Catalog=MyDatabase;Integrated Security=True;User Instance=True

Next, I tried to use a different application to retrieve data from a copy of the same database located in a different directory and used the same connection string as that shown above. When I do this, I receive an error message similar to the following:


Database 'C:PathToMyOriginalProjectinDebugMyDatabase.mdf' already exists. Choose a different database name.

Cannot attach the file 'C:PathToMyNewProjectinDebugMyDatabase.mdf' as database 'MyDatabase'.

I then tried, out of curiosity, to change the Initial Catalog portion of the connection string to "MyDatabase2" and attempt the data retrieval again. The connection string looked like this:


Data Source=(local)sqlexpress02;AttachDbFilename=|DataDirectory|MyDatabase.mdf;Initial Catalog=MyDatabase2;Integrated Security=True;User Instance=True

Interestingly enough, it worked. However, when I switched back to the original connection string, I got the same error message as before.

What's going on here? I thought that one of the virtues of user instances was that they would attach at run-time, then disconnect when the application was through with them. If that's the case, then why am I getting errors stating that a database of the same name is already attached? Is there a way to detach these databases from a user instance? Can it be done by some value in the connection string?

Thank you in advance for your help.

View 4 Replies View Related

Failed To Generate A User Instance SQL Server Express 2005

May 30, 2006

Hello,



I get the following message after updating to sql server express 2005 advanced.
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

I noticed that in my C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLTemplate Data I have not databases? How do I get them back?

I also had to add back the aspnet to the permissions and the network and network service to the app_data folder.

Can any one help?



Thanks



Tom

View 4 Replies View Related

SQL Server Express 2005 - How To Delete/drop A User Instance

May 23, 2008

Hi,

I have been working around with SQL Server Express 2005 on VISTA. I created a small C++2008 application which interface with SSE 2005. When running my application, it automatically created a user instance which I would like to get rid of. I just forgot from start to set "User Instance = False" in my connectionstring. (oups...)

I'm aware, from readings I did, that a couple of tables as well as log files, etc. are created under directory "utilisateurs...AppDataLocalMicrosoftMicrosoft SQL Server DataSQLEXPRESS". SQLEXPRESS is the instance name chosen during install of SSE2005.

Also using following SQL Statement:

select owning_principal_name, instance_pipe_name, heart_beat
from sys.dm_os_child_instances
I got following result:
owning_principal_name: PC-DE-STEPHANEStéphane
instance_pipe_name: \.pipe6172F4E8-622E-4A sqlquery
heart_beat: dead (at this moment...)

==> How can I make a good cleanup of all this as well as get rid of the user instance itself?


Thanks in advance for any help.

Stéphane

View 7 Replies View Related

Cluster: Instance Naming

Sep 3, 2007

Hi all

SQL Server 2005 cluster. Active-Active. We want to create two instances. The two nodes are named:

mike-940-01
mike-940-02

I read somewhere that there can only be ONE default instance in a 2005 cluster. So I interpret that as meaning that I can only have one instance named after a virtual server (example: mike-940-03) and the other instance has to be a slashed instance (example: mike-940-03/instance1). But what if I create another virtual server (example: mike-940-04). Can I install a default instance in that server? Can someone help me clarify this?

Also, if I'm using all slashed instance names, then what does it choose as the base name before the slash? In other words, what decides which virtual server name is used? Is it the management node? Is it one of the nodes?

My objective is to keep consistency in the naming on the cluster. If I have to use slashed instances, then I want all sql server instances to have a slash.

Sorry about the confusing explanation, but that's probably a symptom of MY confusion.

Thanks!

View 4 Replies View Related

Instance Naming Problems

Jun 16, 2006

When I try to Add New Item - Database in VS C# Express, I get "An error has occurred while establishing a conncection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)"

When I open the management studio, I can connect to a database named Dev, and when I try to "Browse for more" from the server selector combobox, it is the only one found. I believe "Dev" was my old MSDE name, although this is also what my "Computer Name" is set to. Unfortunetly the setup of SQL Express didn't ask me what to name my instance.

I thought maybe the SQL Server 2005 Express Toolkit installation didn't actually contain the server software, and only installed the tools, as during the installation the section where I select components only listed things like client tools and what not, with not mention of the server software.

So I thought maybe it didn't install the server, so I downloaded the server installation that is by itself, and installed it, this time I saw the check for hide advanced options, so I went through the advanced options this time. I've have been through this same setup before at work, and both times it has confused me. It seems very different from installing previous versions of SQL server.

Where I choose to create a new instance or upgrade, I choose to upgade, and it is not clear what I'm upgrading, the selector does not display instance names.

At another point it asks me about configuring it to use the Local service, local system, or network account. The documentation of how these differ is vauge. For example, the network account is described basically as "don't use this" without saying what it is.

I was accustomed to just a local account, and network account settings from previous versions, and network was always the logical choice for me to use intergrated security. I don't understand what the new catagories represent and what will be functionally different in the way I connect.

So I'm really confused, and getting back to the instance names. In the surface area configuration as well as the VS Express, it only sees the name as MSSQLSERVER

For example if I "add new connection" from database explorer and click advanced, the datasource drop down lists only ".MSSQLSERVER"

So I'm thoroughly confused at this point and not sure what to do.





View 1 Replies View Related

Connection String For Default Instance Of SQL Server 2005, On A Box Also Running A Named Instance Of SQL Server 2000

Nov 15, 2007

The box I am trying to connect to is running two instances of SQL Server.
There is a SQL Server 2005 instance which is the default. There is a SQL Server 2000 instance which is named 'SQLSERVER'.
 I can connect to the SQL Server 2000 instance no problem:<add key="ConnectionString" value="server=MYPCSQLSERVER;database=mydatabase;user id=****;password=****" />
However,  I am having trouble connecting to the Default SQL Server 2005 instance. I have tried:
<add key="ConnectionString" value="server=MYPC;database=mydatabase;user id=****;password=****" />
 but it doesn't work. I have tried explicitly setting SQL Server 2005 to use port 1434 (as SQL Server 2000 is running on port 1433), and then used:
<add key="ConnectionString" value="server=MYPC,1434;database=mydatabase;user id=****;password=****" />
but this doesn't work either.
 
Am I mssing something here? Any help much appreciated
Thanks...
 

View 2 Replies View Related

One Instance In Express 2005

Oct 18, 2007

Hello everybody, on my first post on this forum

I just installed SQL Server Express 2005 (server) and created default instance SQLEXPRESS, so that, when I want to access in remote mode, the server conn string is: <servername>SQLEXPRESS

But I have been told there is one way to configure SQL Server so that only one instance is allowed, so you dont need to specify any. If this was true, I would only need to give 'servername' to access remotely.

Is this true? How can I achieve this? Will it be possible to doing it after having installed software, or do I have to uninstall and install it again?

Sorry if this is too basic, I am just having first contact with SQL Server

Thanks very much for your help!!!

View 2 Replies View Related

Sql Express 2005 Conflicts With My 2k Instance

Nov 8, 2006

Hello,

i have both server instances installed on same machine, 1st is sql 2k enterprise and 2nd is sqlExpress 2005.

all was working fine till today, i renamed a catalog in the express2005 instance. the reason for this renaming was a duplicate catalog name in the 2k and in the 2005 so when i backup my dbs one is overwriting the other because of the same file name.

after this rename i started to get some errors in the application so i decided to rename it back to its original name and relocate the backup destination to other folder.

now the situation in that i cant login any more to the 2005 server, when i login to servsqlexpress2005 (via manager or via odbc) i see always the 2k server.
i tried to login to any server name like .sqlexpress2005 or whatever i always get to see the 2k catalogs only.

in proccess list i see both sqlserv.exe proccesses, also in services all is working fine, i only cant access to this server in any way.

PLEASE HELP!!!
should i reinstall 2005 instance? i dont wanna do that i have so much configs on it include very massive reporting services


***the more that i try to connect my 2k5 server the problem looks wierd more and more.
when i connected as localhostsqlexpress2005 i succeeded... but in 2-3 minutes connection didnt turn off, but it switched to the 2k server...
it looks like a major bug!!! how can connection switch himself between 2 server without even notice??

View 4 Replies View Related

Do Not Have Instance Of SQL Express 2005 Installed

Oct 8, 2006

I am attempting to install SQL Express 2005 on a laptop that already has MS Sql Server installed.

I downloaded the SQLEXPR_TOOLKIT.EXE from Microsoft's website and let it go through its installation routine accepting all the default answers.

When I open SQL Server Management Studio Express, I can only connect to the SQL 2000 instance. I have issued the 'SELECT @@VERSION' command, and When I try to connect to the instance COMPUTERNAMESQLEXPRESS, the following error message is displayed:
Cannot connect to YOUR-F8A010A9D0SQLEXPRESS.
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure my be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error locating Server/Instance Specified) (Microsoft SQL Server)

When I go to remove SQL Express 2005 using the add/remove programs, there is a check box that says
"Remove SQL Server 2005 instance components"
and in the box underneath where it lists all the instances it says: "No instances have been installed"

How do I create an instance for SQL Server 2005?

Thank you
Susan

View 1 Replies View Related

Run Simultaneously Msde 2000 Instance And One Of 2005 Express, Possible?

Dec 2, 2006

Hi,
I got on my developer computer one instance of msde 2000. I want to test sql server express 2005, can I install it without "scrap" my other instance of 2000?

Strange question maybee, but it's what I wanna do!

Thanks all!

View 3 Replies View Related

How To Use Xcopy && User Instance To Copy 3 Dbo Tables From The Database Of SQL Server Management Studio Express To The App_Data Folder Of Website Of VWD Express Project?

Jan 6, 2007

Hi all,
I have read/studied (i) Working with Databases in Visual Web Developer 2005 Express in http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/vwd.aspx, (ii) Xcopy Deployment (SQL Server Express) in http://msdn2.microsoft.com/en-us/library/ms165716.aspx, (iii) User Instances for Non-Administrators in http://msdn2.microsoft.com/en-us/library/ms143684.aspx, and (iv) Embedding SQL Server Server Express in Applications in http://msdn2.microsoft.com/en-us/library/ms165660.aspx.  I do not understand the concepts and procedures to do Xcopy and User Instances for non-administrators completely-I do not know how to connect to databases and create database diagrams or schemas using the Database Explorer.  I have a stand-alone Windows XP Pro PC. I have created a ChemDatabase with 3 dbo tables in the SQL Server Management Studio of my SQL Server Express and a website of my VWD Express application with an App_Data folder.  I am not able to proceed to use Xcopy and user instance to bring the 3 dbo tables of ChemDatabase to my App_Data folder. Please help and give me some detailed procedures/instructions to bring the 3 dbo tables of ChemDatabase (or ChemDatabase itself) from the SQL Server Management Studio Express to the App_Data folder of the website of my VWD Express project? 
Thanks in advance,
Scott Chang 
 

View 3 Replies View Related

How To Upgrade SQL 2005 Express Instance To Advanced Services For Text Search

Apr 8, 2008

Have searched a good bit for a KB or other article but haven't been able to find one.

I have a 2003 server with SQL Server 2005 Express installed, but not the Advanced Services version. Recently installed an application that needs the Full Text search capability. Would prefer not to remove SQL Server Express and reinstall the Advanced version because I'm also using Symantec Backup Exec 11d which has its own instance on the SSExpress installation.

Is it possible to upgrade an instance to Advanced Services? If not, is it possible to upgrade the entire install?

There's got to be a how-to article somewhere on how to do this. Just can't seem to locate it at Microsoft or with Google.

Thanks for any help.

View 1 Replies View Related

How To Apply SQL Server 2005 Express SP1 To The Version Of SQL Server 2005 Express Which Installs With Visual Studio 2005?

Aug 8, 2006

When I installed VS 2005, it installed the default version of SQL Server 2005 Express that ships with Visual Studio 2005 installer media.

How can apply SQL Server 2005 Express SP1 to update this existing instance?

Currently, if I run this query:

SELECT @@version

I get the following:

Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

After applying SP1, I should get 9.00.2047.00.


Should I just go to this link and download & install the SQL Server 2005 Express Edition SP1:

http://msdn.microsoft.com/vstudio/express/sql/download/


Thank you,

Bashman

View 11 Replies View Related

Can't See The SQL Server Express Instance On SQL Browser

Feb 8, 2007

Hi All,

I am using SQL Server Express to connect to the network using VPN on a local machine. I have done the following..

a.) Enabled the remote connections for the Express Instance and rebooted the machine.

b.) Connected to the machine with Express Edition locally and can also connect other SQL Server instances from it to verify connectivity.

c.) Yes, SQL Browser Service is running.

d.) Firewall is not turned on, so I do not have to configure any exceptions.

Now here is the big problem: When I browse for SQL Servers on the network the machine does not show up on the list, i.e "macinenameSQLExpress". I had uninstalled and reinstalled the Express edition and rebooted the machine several times with no luck on the SQL Express Instance showing up on the browser list. I even changed the default instance name to "machinenameMACHINE1" on one of the reinstalls. However, I can connect to other SQL Instances from it. But, I cannot connect to it from other machines since its not registered on the network. I have been working on this for the past few days by looking for a solution via this and other forumns. Is there some setting somewhere that I am missing that prevents this instance from not showing up on the browser list. This issue with SQL Express Edition is baffling as well as frustrating and any ideas that can resolve this issue is very much appreciated.

View 15 Replies View Related

Re-Index SQL Server Express User Instance?

Dec 29, 2006

Is there a way to re-index a SQL Server Express User Instance?  If I try to open the .mdf while the website is still running, I get a message stating that the file is in use.  If I shut down the web service and open the .mdf, then restart the website, then the website cannot access the .mdf while I have it open in VStudio (reminds me a lot of Access).
In the past I tried to open a user instance with SQL Server Management Studio, but then it goofed up my user-instance...so I am hesitant to try that again.  Is there any way to re-index?
Thanks!

View 1 Replies View Related

How To Build A Sql Server Instance In The Network Using Sql Express?

Dec 7, 2006

Hi,



how to build a sql server instance in the network using sql express?



thank you.

View 7 Replies View Related

Cannot Connect To SQL Server DB Engine...Instance Contains SQL Express In Name

Oct 11, 2007

I recently installed SQL Server and Visual Studio. When I went into SQL Server, I could only connect to a SQL EXPRESS Database engine. I need to access the full Database. I tried disconnecting it, uninstalling/reinstalling. Now I cant connect to the SQL EXPRESS DB Object. There are no SQL Server services running.

Please help.

Thanks

View 8 Replies View Related

Cannot See The SQL Express Instance On The Network Server List...

Feb 2, 2007



I have installed SQL Server Express and I can connect with it locally using "localcomputernameSQLEXPRESS". It is configured for remote connection and for some reason, when I browse for this instance on the Network Server, it does not appear in the list. I have unistalled/installed it several times and still I cannot see this instance on the SQL Network server list. Can anyone help troble shoot this frustrating issue...

Thanks!

SAM

View 1 Replies View Related

Upgrading From Sql Server 2005 Express Edition To Sql Server 2005 Express With Advanced Services

Oct 4, 2006

If i have been using sql server 2005 express for developing my application and i decide to upgrade to sql server 2005 express with advanced services while still working on the same application, what will happen to my  application's database. Can i be able to continue with my work with out any major regrets.

View 1 Replies View Related

Edited Data Won't Propagate Back To The Database (VB 2005 Express &&amp; SQL Server 2005 Express)

Dec 11, 2006



Hi,

I'm trying to learn some VB programming with the VB 2005 Express Absolute Beginner Series video tutorials (which I think is great) and have come across a problem that I can't solve.

When I follow the instructions in Lesson 9 (Databinding Data to User Interface Controls) my application will display the data from the database correctly and I can edit it (and as long as the debugger is running the data remains changed). However, the changes won't propagate back to the database. I don't get any error messages but after I edit the data, save (with the save button on the BindingNavigator toolbar), and end debugging the data in my database remains unchanged. When I use a MessageBox to show how many rows where edited/updated in the

Me.myTableTableAdapter.Update(Me.myDatabaseDataSet.myTable)

I get the correct number back. I'm sure the problem is not due to coding errors since I've also tried running the accompanying Lesson 9 project file that can be downloaded from MSDN and the problem persists.

I'm using Windows XP SP2, SQL Server 2005 Express Edition and VB 2005 Express Edition. I've tried installing SQL Server 2005 Express with a number of different settings, including default settings, but it doesn't make any difference.

Would greatly appreciate any feedback on this as I'm keen to resolve this problem so I can get on with the next tutorial lesson.

Thanks,
Ieyasu

View 6 Replies View Related

Failed To Generate A User Instance Of SQL Server Using Sql Server Express And Vwde. Why?

Jan 15, 2007

I've set up a website on another computer using sql server express and visual web developer express, and it works as expected. However halfway through the development i've had to move to another computer. I installed visual web developer express + sql server express, and copied the project files across, but now when I attempt to run it I get the error:Failed to generate a user instance of SQL Server due to a
failure in starting the process for the user instance. The connection
will be closed. I've tried reinstalling the software and it doesn't help. Any idea why this is happening, and what I can do to fix it?thanks 

View 3 Replies View Related

SQL Server Express: Install As Default Or Named Instance?

Jan 9, 2007

Hi Folks, 
Is it better to install SQL Server Express Default or install as Named Instance?
What are the pros and conns?
Thanks

View 1 Replies View Related

SQL Server Mgmt Studio Express And User Instance Mdf

Dec 10, 2006

how do I attach my user instance mdf and chagne scheme etc? for example my mdf is at c:sqldatamyapp.mdf



I tried attach and got

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Attach database failed for Server 'IEI-A64SQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

------------------------------

Directory lookup for the file "c:sqldatamyapp.mdf" failed with the operating system error 5(Access is denied.). (Microsoft SQL Server, Error: 5133)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.2047&EvtSrc=MSSQLServer&EvtID=5133&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
I was able to run application with integrated security on teh mdf file.

View 3 Replies View Related

Attaching A SQL Express Database To SQL Server Standard Instance...

Oct 18, 2006

If I create a database in SQL Express and then copy the MDF/LDF files and attach them to a machine running SQL Server 2005 Standard - will this new database have SQL Express limitations?

Are there good reasons not to do this and create the database in SQL Server Standard using scripts generated from the SQL Express instance instead?

Basically, I'm setting up a merge replication between Standard and SQL Express for a common database and I figure attaching a copy of the database created in SQL Express is the fastest way to get this started.

View 3 Replies View Related

Naming Syntax In 2005

Mar 12, 2006

Here is a simple question. I am having difficulty accessing booksonline at Microsoft so I thought I would ask here. What is thestandard naming syntax for Sqlserver 2005? Assuming I had thefollowing table, [proddb01].[details].[dbo].[daily_tranx], how would Irefer to it in the new version?Thanks a lot!

View 5 Replies View Related

How Can I Onnect Visual Basic Express 2005 To A Remote SQL Server Express 2005?

Sep 13, 2006

HiIm trying to connect Visual Basic Express 2005 to a remote SQL Server Express 2005. I cant find how i can do that in VB.net Express.In Web developer there are no problem to connect to a remote SQL server but i cant find it in VB.net Express. The XP with the SQL server that i want to connect to is on the local network. Greatful for help!

View 1 Replies View Related

Visual Basic 2005 Express And SQL Server 2005 Express - Display Image

Jun 13, 2007

Hi Guys,
I created a Product database table using Visual Basic 2005 Express and SQL Server 2005 Express. I have just added a new column [Picture] to the database table, which of course, should store an image or picture of a product. I am writing to kindly ask you guys for help .


i) How do I include image files into this column [Picture]?
ii) How do I get this image to display on Visual Basic 2005 Express form, so that when a product is selected the product image is displayed accordingly?


Your help much appreciated. Thanks.

Paul

View 8 Replies View Related

Detach Database File From Local SQL Server Express Instance By C#?

Jan 30, 2008

I am using the following C# code to establish a SQL connect to a SQL database file:

// connection string
// attach a SQL database file to a local SQL server express instance
string _connectionString = @"Server=.SQLExpress; AttachDbFilename=C:BalanceDatabase_1.mdf; Trusted_Connection=Yes; User Instance=True";

// using System.Data.SqlClient;
SqlConnection _sqlConnection = new SqlConnection(_connectionString);
// open the connection
_sqlConnection.Open();

// do something

// close the connection
_sqlConnection.Close();

So far, the connection works fine.

However, next, I want to copy the database file to another folder. So the following codes:
// source database file name
string sourceDatabaseFileName = @"C:BalanceDatabase_1.mdf";
// target database file name
string targetDatabaseFileName = @"D:BalanceDatabase_1.mdf";
// copy database file
System.IO.File.Copy(sourceDatabaseFileName, targetDatabaseFileName, true);

Then the program came with runtime exception: "IOException was unhandled: The process cannot access the file 'C:BalanceDatabase_1.mdf' because it is being used by another process."


Is it because the database file was sill attached to the local SQL Server express instance? What can I do to bypass this problem? Detach the database file? or dispose the local SQL Server express instance?

Many thanks indeed!

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved