Connection to SQL Server only.

K

Ken Varn

I need to run the stored procedure sp_attach_single_file_db to attach a
local database using ADO.NET. I am not sure of the connection string I
should use for this since I am not connecting to any particular database,
only SQL Sever itself.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
 
W

William \(Bill\) Vaughn

Note that ADO.NET 2.0 will permit you do attach an MDF database file from
the connection string... AttachDBFilename=my.mdf;

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
P

Pablo Castro [MS]

Note that you can use AttachDbFileName in 1.0 and 1.1 as well. The new thing
in 2.0 is that we support relative paths now. In 1.0 and 1.1 you need to
make sure you provide a full path or a path relative to the SQL Server
process' current directory (I'd recommend to always specificy a full path).

--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.


William (Bill) Vaughn said:
Note that ADO.NET 2.0 will permit you do attach an MDF database file from
the connection string... AttachDBFilename=my.mdf;

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top