Click here to Skip to main content
15,892,809 members
Home / Discussions / C#
   

C#

 
GeneralRe: Asynchronous Question Pin
Programm3r4-Dec-09 3:06
Programm3r4-Dec-09 3:06 
AnswerRe: Asynchronous Question Pin
Abhinav S4-Dec-09 3:14
Abhinav S4-Dec-09 3:14 
GeneralRe: Asynchronous Question Pin
Programm3r4-Dec-09 3:23
Programm3r4-Dec-09 3:23 
GeneralRe: Asynchronous Question Pin
Abhinav S4-Dec-09 3:33
Abhinav S4-Dec-09 3:33 
AnswerRe: Asynchronous Question Pin
Alan N4-Dec-09 3:32
Alan N4-Dec-09 3:32 
QuestionReportViewer VS 2008 Pin
staticv4-Dec-09 2:12
staticv4-Dec-09 2:12 
AnswerRe: ReportViewer VS 2008 Pin
Giorgi Dalakishvili4-Dec-09 3:37
mentorGiorgi Dalakishvili4-Dec-09 3:37 
QuestionAttaching to Membership Database Pin
froofy4-Dec-09 1:15
froofy4-Dec-09 1:15 
Hi,

I want to connect to an ASP.NET Membership database from a command line as I need to list the user details.

The code I've come up with will connect to a named database easily enough but a membership database is local to an ASP.NET web site so I don't really know what to do. I can locate the MDF and log files easily enough but the database name can't be seen in Management Studio unless I attach to it and I need the database name to get the database owner so that I can then attach to the databse.

If I attach to it in Management Studio, the database name appears to be a large string including the absolute path, but there must be a way of deriving the database name from the MDF file itself, surely?

If I use the name I find in Management Studio I get an error message stating that I can't attach a database with the same name as an existing one! This is when the database is attached in Management Studio. I then detach it in Management Studio, run my code again and when it tries to get the database owner by specifying the database name in the Server.Databases list, I get an unreferenced object error. I'm completely confused!

So what I want to know is, how to I connect to a database using only its MDF file (and LDF file if necessary)?

Thanks Cool | :cool:
AnswerRe: Attaching to Membership Database Pin
Eddy Vluggen4-Dec-09 3:14
professionalEddy Vluggen4-Dec-09 3:14 
GeneralRe: Attaching to Membership Database Pin
froofy4-Dec-09 5:17
froofy4-Dec-09 5:17 
QuestionPerformance tip on extracting BLOB from database? Pin
Thomas ST3-Dec-09 23:38
Thomas ST3-Dec-09 23:38 
AnswerRe: Performance tip on extracting BLOB from database? Pin
Luc Pattyn4-Dec-09 1:49
sitebuilderLuc Pattyn4-Dec-09 1:49 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 2:43
Thomas ST7-Dec-09 2:43 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Luc Pattyn7-Dec-09 3:15
sitebuilderLuc Pattyn7-Dec-09 3:15 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 7:23
Thomas ST7-Dec-09 7:23 
AnswerRe: Performance tip on extracting BLOB from database? Pin
PIEBALDconsult4-Dec-09 3:58
mvePIEBALDconsult4-Dec-09 3:58 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 1:23
Thomas ST7-Dec-09 1:23 
GeneralRe: Performance tip on extracting BLOB from database? Pin
PIEBALDconsult7-Dec-09 4:30
mvePIEBALDconsult7-Dec-09 4:30 
GeneralRe: Performance tip on extracting BLOB from database? Pin
Thomas ST7-Dec-09 7:27
Thomas ST7-Dec-09 7:27 
QuestionDataGridview Drag and drop Pin
anishkannan3-Dec-09 23:04
anishkannan3-Dec-09 23:04 
QuestionNeed sample code Pin
kankeyan3-Dec-09 20:12
kankeyan3-Dec-09 20:12 
AnswerRe: Need sample code Pin
dan!sh 3-Dec-09 20:49
professional dan!sh 3-Dec-09 20:49 
AnswerRe: Need sample code Pin
PIEBALDconsult4-Dec-09 4:00
mvePIEBALDconsult4-Dec-09 4:00 
GeneralC# and timer Pin
nsjn3-Dec-09 19:46
nsjn3-Dec-09 19:46 
GeneralRe: C# and timer Pin
The Man from U.N.C.L.E.3-Dec-09 22:14
The Man from U.N.C.L.E.3-Dec-09 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.