Home All Groups Group Topic Archive Search About

Opening MDF files with ADO.NET 2.0

Author
15 Feb 2006 12:30 AM
rasx
An article in SQL Server magazine mentioned in passing that we can open MDF
files directly with ADO.NET 2.0. Is this true? Are there any
examples/tutorials of this? Does this mean that ADO.NET 2.0 is kind of like a
scaled-down in-memory version of SQL Server?

--
Bryan, Emperor of String.Empty
http://songhaysystem.com

Author
15 Feb 2006 4:13 AM
William (Bill) Vaughn
Ah no.
When you use AttachDBFilename, you still must reference a valid SQL Server
instance. The .MDF is attached to the master DB and remains attached from
that point forward. You can also opt to use the "Local Instance=True"
option. This copies the master and other SS support databases to the user's
filespace and then copies the .MDF file there too. This feature (SQL Server
Express only) permits full access to the user database by that user and
permits it to be uninstalled with the application.

I discuss this in detail in my new book (due out this summer).

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
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.
__________________________________

Show quote
"rasx" <rasx (an email account) at songhaysystem.com> wrote in message
news:F6B3C445-0152-406C-849C-4313550556DA@microsoft.com...
> An article in SQL Server magazine mentioned in passing that we can open
> MDF
> files directly with ADO.NET 2.0. Is this true? Are there any
> examples/tutorials of this? Does this mean that ADO.NET 2.0 is kind of
> like a
> scaled-down in-memory version of SQL Server?
>
> --
> Bryan, Emperor of String.Empty
> http://songhaysystem.com
Author
15 Feb 2006 6:19 AM
rasx
Got it. Without the benefit of a code sample, I'm going to take another wild
guess. ADO.NET 2.0 allows us to refer to MDF files directly as a kind of
shorthand instead of knowing the SQL Server instance name and catalog. This
makes life easier for SQL Server Express? Am I close here?
--
Bryan, Emperor of String.Empty
http://songhaysystem.com


Show quote
"William (Bill) Vaughn" wrote:

> Ah no.
> When you use AttachDBFilename, you still must reference a valid SQL Server
> instance. The .MDF is attached to the master DB and remains attached from
> that point forward. You can also opt to use the "Local Instance=True"
> option. This copies the master and other SS support databases to the user's
> filespace and then copies the .MDF file there too. This feature (SQL Server
> Express only) permits full access to the user database by that user and
> permits it to be uninstalled with the application.
>
> I discuss this in detail in my new book (due out this summer).
>
> hth
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> 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.
> __________________________________
>
> "rasx" <rasx (an email account) at songhaysystem.com> wrote in message
> news:F6B3C445-0152-406C-849C-4313550556DA@microsoft.com...
> > An article in SQL Server magazine mentioned in passing that we can open
> > MDF
> > files directly with ADO.NET 2.0. Is this true? Are there any
> > examples/tutorials of this? Does this mean that ADO.NET 2.0 is kind of
> > like a
> > scaled-down in-memory version of SQL Server?
> >
> > --
> > Bryan, Emperor of String.Empty
> > http://songhaysystem.com
>
>
>
Author
15 Feb 2006 4:23 PM
William (Bill) Vaughn
Not really. You still need to know the server name (machine name) and
instance to get the AttachDBFilename to work.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
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.
__________________________________

Show quote
"rasx" <rasx (an email account) at songhaysystem.com> wrote in message
news:6D758B7F-3EBD-46B2-BF50-088702D193A1@microsoft.com...
> Got it. Without the benefit of a code sample, I'm going to take another
> wild
> guess. ADO.NET 2.0 allows us to refer to MDF files directly as a kind of
> shorthand instead of knowing the SQL Server instance name and catalog.
> This
> makes life easier for SQL Server Express? Am I close here?
> --
> Bryan, Emperor of String.Empty
> http://songhaysystem.com
>
>
> "William (Bill) Vaughn" wrote:
>
>> Ah no.
>> When you use AttachDBFilename, you still must reference a valid SQL
>> Server
>> instance. The .MDF is attached to the master DB and remains attached from
>> that point forward. You can also opt to use the "Local Instance=True"
>> option. This copies the master and other SS support databases to the
>> user's
>> filespace and then copies the .MDF file there too. This feature (SQL
>> Server
>> Express only) permits full access to the user database by that user and
>> permits it to be uninstalled with the application.
>>
>> I discuss this in detail in my new book (due out this summer).
>>
>> hth
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant
>> Microsoft MVP
>> INETA Speaker
>> 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.
>> __________________________________
>>
>> "rasx" <rasx (an email account) at songhaysystem.com> wrote in message
>> news:F6B3C445-0152-406C-849C-4313550556DA@microsoft.com...
>> > An article in SQL Server magazine mentioned in passing that we can open
>> > MDF
>> > files directly with ADO.NET 2.0. Is this true? Are there any
>> > examples/tutorials of this? Does this mean that ADO.NET 2.0 is kind of
>> > like a
>> > scaled-down in-memory version of SQL Server?
>> >
>> > --
>> > Bryan, Emperor of String.Empty
>> > http://songhaysystem.com
>>
>>
>>

AddThis Social Bookmark Button