473,382 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Opening existing project

12
HEllo all,

I got a project sent to me, and I want to open it, it is delivered with a .mdf file. I downloaded VS 2008 and SQL server 2005, and i opened the project with VS2008.
But when i want to open a page that required data the page says:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


Now I really don't know what to do to make sure the .mdf info will work, how should I do this? I open Microsoft SQL 2005 server, but what should I do then??
(Sometimes people talk about 'attaching', but I don't have a clue what that means, or how to do it..)

Cheers and thanks
Sep 7 '07 #1
8 1747
Purple
404 Expert 256MB
Hi BD5 and welcome to TSDN

did you get a database_name.ldf file too ?

copy both the .mdf and .ldf files into the data directory of

program files / microsoft sql server / mssql / data

the path should look something like above, you will see other .mdf and .ldf files in there.

then use microsoft sql server management studio to connect to your sql server. Right click on the database folder and select attach, follow the wizard..

hope that helps

Regards Purple
Sep 7 '07 #2
BD5
12
did you get a database_name.ldf file too ?



Regards Purple
Thanks for the help!

I did not get a .ldf file with it... is it necessary?? By the way, that manager program you are talking about.. is it this program:
http://users.pandora.be/vipers/screenn.jpg


Because I right clicked those items, but I can't find attach..
Sep 7 '07 #3
BD5
12
Can anyone help me please? :) I am really stucking here..
Sep 8 '07 #4
Shashi Sadasivan
1,435 Expert 1GB
Can anyone help me please? :) I am really stucking here..
Hi BD5,
open SQL Sever, and connect to the sever...(it should connect on startup)
wight click on databases -> Attach

click add and choose the .mdf file u got.

Now on the window just below that, select the .ldf file, and remove it.

And then click OK.

Cheers
Sep 9 '07 #5
BD5
12
Thank you!

I could attach it!

But when I want to open a page, I still get this error:


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:


Line 97: private void LoadAndBindQuery(Query query)
Line 98: {
Line 99: EventsRepeater.DataSource = query.ExecuteReader();
Line 100: EventsRepeater.DataBind();
Line 101: }


How can I fix this?Thank you guys!
Sep 14 '07 #6
ck9663
2,878 Expert 2GB
Thank you!

I could attach it!

But when I want to open a page, I still get this error:


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source Error:


Line 97: private void LoadAndBindQuery(Query query)
Line 98: {
Line 99: EventsRepeater.DataSource = query.ExecuteReader();
Line 100: EventsRepeater.DataBind();
Line 101: }


How can I fix this?Thank you guys!

check the way your program/application is connecting to your db. there are tons of ways you can connect into db so depending on the way your application connects, you can start from there.
Sep 14 '07 #7
BD5
12
I currently use this connectionstring:
The database file was Project.mdf

<connectionStrings>
<add name="ProjectConnectionString" connectionString="Data Source=.;Initial Catalog=Project;Integrated Security=True;"/>
</connectionStrings>

<SubSonicService defaultProvider="SqlDataProvider" fixPluralClassNames="true">
<providers>
<add name="SqlDataProvider" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="ProjectConnectionString"/>
</providers>
</SubSonicService>



Is this wrong?
Sep 15 '07 #8
ck9663
2,878 Expert 2GB
I currently use this connectionstring:
The database file was Project.mdf

<connectionStrings>
<add name="ProjectConnectionString" connectionString="Data Source=.;Initial Catalog=Project;Integrated Security=True;"/>
</connectionStrings>

<SubSonicService defaultProvider="SqlDataProvider" fixPluralClassNames="true">
<providers>
<add name="SqlDataProvider" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="ProjectConnectionString"/>
</providers>
</SubSonicService>



Is this wrong?

http://www.connectionstrings.com/
Sep 16 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike Labman | last post by:
I am trying to connect to a remote server to open an existing project. I go to File|Open|Project from web. After I enter the URL and hit OK, it waits for a while and then pops up the standard...
3
by: Cemoran | last post by:
I am fairly new to .Net and I am having a problem opening a web project in visual studio .Net. I created a web project from an existing project in the manner described in an MSDN article. The...
0
by: sklett | last post by:
I hate having to go to a new machine and open an existing web project. So I tool my project home from work. Followed these steps: 1) saved project contents into folder under wwwroot 2) created...
5
by: Brad | last post by:
I'm running 2003 server std, have multiple web sites and use host headers to differentiate the web sites (I'm on a domain using DHCP so can't use static IP's). I'm using VS2003 to create and...
0
by: Hongbo | last post by:
Hi, I use VS.Net 2003 with Visual SourceSafe 6.0d on a Windows 2000 Standard Server. Today, when I tried to open an existing ASP.Net project from VS.Net, the "Set Project Location" window came...
1
by: PK9 | last post by:
I am receiving the following error in Visual Studio 2003: "the web server reported the following error when attempting to create or open the web project HTTP/1.1 403 Access Forbidden" I am...
0
by: QuenteK25 | last post by:
Ok so I'm pretty novice at all of this VB stuff, but I have to do a personal project for a class I'm in and it's in VB. So there are a few things I want to do for it that we have never covered in...
1
by: =?Utf-8?B?d2lubGlu?= | last post by:
Hello Using VS 2005 VB.net when a class library gets created you can right click the project and add a Windows Application and then set it as the "startup project" then in the Windows...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.