?
Solved

visual studio web developer 2010 SQL Connection

Posted on 2011-10-15
15
Medium Priority
?
424 Views
Last Modified: 2012-05-12
I only need to import a SQL database file into my project. (I'm a beginner in C#.net) When I import the file and click OK, it gives me the following error. Please look at the attachment. Pleases provide clear instructions step by step. I also included a copy of my configuration in the screenshot. The SQL file that I need to import was created with the same project but even though I imported all the files from the previous project into visual studio, I cannot import the SQL file.

Thank you all,
Paul
 error
0
Comment
Question by:pauledwardian
  • 8
  • 7
15 Comments
 
LVL 15

Expert Comment

by:Eyal
ID: 36975081
I assume it's something related to security
0
 

Author Comment

by:pauledwardian
ID: 36975162
can u be more specific based on the screenshot I uploaded?
0
 
LVL 15

Expert Comment

by:Eyal
ID: 36975187
first I would try to add user Everyone to the file and see what happens

can you access the database from the same machine?
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 

Author Comment

by:pauledwardian
ID: 36975568
I got the same error.
0
 
LVL 15

Expert Comment

by:Eyal
ID: 36975574
can you connect the database from management studio on the server?
0
 

Author Comment

by:pauledwardian
ID: 36976601
The server that has managment studio is my personal computer at home. Anyways, I recieved an error. Please look at the attachment:
 Error in SQL
0
 
LVL 15

Expert Comment

by:Eyal
ID: 36976697
can you post the mdf file here?
0
 

Author Comment

by:pauledwardian
ID: 36976728
Here you go:

 Address.MDF
0
 
LVL 15

Expert Comment

by:Eyal
ID: 36976943
you have to have this 2 files in order to open the file

C:\Program Files\Microsoft SQL Server\MSSQL\data\AddressBook_Data.MDF
C:\Program Files\Microsoft SQL Server\MSSQL\data\AddressBook_Log.LDF

can you do a full backup of the original database?
0
 

Author Comment

by:pauledwardian
ID: 36977069
I downloaded these two files that was included in an open source project on the web.
I changed the extension of log file from LDF to MDF so I can upload both here:
 Address.MDF
 AddressBook-Log.MDF
0
 
LVL 15

Expert Comment

by:Eyal
ID: 36977146
now it worked in my side :)

put the ldf right next to the mdf and try.
if not helping attach the database to your local instance of sql express
0
 

Author Comment

by:pauledwardian
ID: 36977469
can you tell me how you did it? I have windows 7 64 bit with sql management studio 2008 visual studio 2010 web developer (express) installed on my computer. Maybe im doing it wrong!
0
 

Author Comment

by:pauledwardian
ID: 36981647
Eval would you please tell me how you did it? I have windows 7 64 bit with sql management studio 2008 visual studio 2010 web developer (express) installed on my computer. Maybe im doing it wrong!
I basically need to open this MDF sql database in my web developer visual studio 2010 project. Please advice.
0
 
LVL 15

Accepted Solution

by:
Eyal earned 1500 total points
ID: 36984047
1) take the 2 files and put them where you want them to be
2) from the database node in the management studio select attach
3) on the opened screen press the add and select the mdf file (must be on same machine)
4) after you select the MDF you will get on the bottom of the screen 2 records.
5) fix the paths of the files on both rows
6) press OK
0
 

Author Closing Comment

by:pauledwardian
ID: 37004183
thanks
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question