Click here to Skip to main content
15,906,285 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am new to SQL Express 2008, only used normal SQL server
before.

I need to know how to attach the db also
the connection string please.

Any help would be appriciated.
Posted

Try to open the local SqlExpress server from the server explorer of visual studio.

If you are able to see get the sqlexpress open from server explorer you can check the property window of any database and find the connectionstring there.

P.S. sqlexpress is a subset of sqlserver so you wont find much difficulty in using it.
 
Share this answer
 
Comments
bluesathish 9-Mar-12 4:45am    
nice, take 5!
C#
Here is what my connection string looks like (the private information is changed):

"Data Source="MACHINENAME\\SQLEXPRESS";User ID="Admin";Password="the_password";InitialCatalog="MyDatabase";Integrated Security=True";

if this is not work try this link..!
http://stackoverflow.com/questions/997169/c-sharp-2008-sql-server-express-connection-string[^]
 
Share this answer
 
 
Share this answer
 
Dear Ben,

To attach a database

In SQL Server Management Studio Object Explorer, connect to an instance of the Microsoft SQL Server Database Engine, and then expand that instance.

Right-click Databases and click Attach.

In the Attach Databases dialog box, to specify the database to be attached, click Add; and in the Locate Database Files dialog box, select the disk drive where the database resides and expand the directory tree to find and select the .mdf file of the database; for example:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008R2_Data.mdf



Optionally, to specify a different name for the database to attach as, enter the name in the Attach as column of the Attach Databases dialog box.

Optionally, change the owner of the database by selecting a different entry in the Owner column.

When you are ready to attach the database, click OK.

Note: A newly attached database is not displayed in the Databases node of Object Explorer until the view is refreshed. To refresh the view at any time, click in Object Explorer, and then click Refresh on the View menu.

Regards,
Bluesathish
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900