4 Replies - 1085 Views - Last Post: 30 March 2013 - 11:32 AM Rate Topic: -----

#1 Timeflies  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 26-February 13

Problem adding database source (MDF)

Posted 29 March 2013 - 09:36 AM

This is my first time programming with database files and I following an example in a book but ran into a problem. I was given an MDF file so I..

-Created a simple windows form application in C# 2010 express
-Opened up the database explorer tab(data sources)
-Clicked on connect to database
-Used "Microsoft SQL server database file"
-Browsed for the MDF file and used windows authentication

When I click OK I receive an error saying
Posted Image


I have SQl server management studio 2012 installed on my computer but I'm not exactly sure what the problem is as I am following exactly what the book says to do? Thanks for any help!

Is This A Good Question/Topic? 0
  • +

Replies To: Problem adding database source (MDF)

#2 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3371
  • View blog
  • Posts: 11,420
  • Joined: 12-December 12

Re: Problem adding database source (MDF)

Posted 29 March 2013 - 10:30 AM

Did you start the server firstly using SQL Server Configuration Manager? I have to do this on my computer - I don't know if it is possible to start it from within Visual Studio (well, not without a batch file).

Did you enter the correct name for your server, which on my computer is:

MYCOMPUTERNAME\SQLEXPRESS

This post has been edited by andrewsw: 29 March 2013 - 10:36 AM

Was This Post Helpful? 1
  • +
  • -

#3 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3371
  • View blog
  • Posts: 11,420
  • Joined: 12-December 12

Re: Problem adding database source (MDF)

Posted 29 March 2013 - 10:37 AM

FWIW I created a simple batch file to start and stop my server:

NET START "SQL Server (SQLEXPRESS)"||NET STOP "SQL Server (SQLEXPRESS)"

Was This Post Helpful? 1
  • +
  • -

#4 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3371
  • View blog
  • Posts: 11,420
  • Joined: 12-December 12

Re: Problem adding database source (MDF)

Posted 29 March 2013 - 10:44 AM

Firstly, however, I Attach my database(s) from within SQL Server Management Studio, so I'm unaware if this is also a required step.
Was This Post Helpful? 1
  • +
  • -

#5 Timeflies  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 26-February 13

Re: Problem adding database source (MDF)

Posted 30 March 2013 - 11:32 AM

Thanks for the reply! Didn't try that as I wasn't sure if that was needed but this could be the problem; I receive an error trying to open SQL Server Configuration Manager?

Same error here
http://social.msdn.m...18-6e33dda2bc46
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1