Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 10th, 2007, 03:21 PM
Authorized User
 
Join Date: Jun 2007
Location: Amman, Amman, Jordan.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naeem.net Send a message via Yahoo to naeem.net
Default asp.net & sql server database

hi sirs,

 i tired made connection between sql server database and asp.net2.0 and i succesed do it in my localmachine , but when i did it in my web i got this error messege :

Invalid value for key 'attachdbfilename'

the connection string used :

<connectionStrings>
<add name="dashConnectionString1" connectionString="Data Source=208.116.16.3;AttachDbFilename=|DataDirector y|/dash.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

can any one help me plz.

Thanks in advance,


Ali Naeem
__________________
Ali Naeem
  #2 (permalink)  
Old July 10th, 2007, 03:56 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,190
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

did you copy the database to the web site???
do it have sql 2005 installed??? why do you have a datasource, if that IP is from your pc you will have to change it to the local IP...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
  #3 (permalink)  
Old July 11th, 2007, 09:50 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by naeem.net
 ...but when i did it in my web i got this error messege...

Can you elaborate on what "my web" is? Is this a web host?

Chances are that you are uploading to a system that does not have SQL Server Express installed on it, but rather a full version of SQL Server. The full versions don't use the dynamic attach that SQL Server Express uses. You need to have a database set up on the host's database server.

-Peter
  #4 (permalink)  
Old July 11th, 2007, 10:12 AM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,957
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

You may want to take a look here:

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395

It discusses various deployment solutions that should help you get SQL up and running with your ISP.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #5 (permalink)  
Old July 13th, 2007, 03:39 PM
Authorized User
 
Join Date: Jun 2007
Location: Amman, Amman, Jordan.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naeem.net Send a message via Yahoo to naeem.net
Default

Quote:
quote:Originally posted by planoie
 
Quote:
quote:Originally posted by naeem.net
Quote:
 ...but when i did it in my web i got this error messege...

Can you elaborate on what "my web" is?  Is this a web host?

Meant, i want use the SQL server database in web application. so what I should have to do it??

Chances are that you are uploading to a system that does not have SQL Server Express installed on it, but rather a full version of SQL Server.  The full versions don't use the dynamic attach that SQL Server Express uses.  You need to have a database set up on the host's database server.

-Peter
Ali Naeem
  #6 (permalink)  
Old July 13th, 2007, 03:48 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,957
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

Did you read the article I linked to? It describes the steps you need to perform to use SQL Server in your ASP.NET applications.

If 208.116.16.3 is not the IP of your local machine or that machine is not running SQL Server Express, you can't use AttachDbFilename. Instead, you need to attach the database to SQL Server. Then you need to setup the correct connection string to the server.

All of this is described in my article.

HtH,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #7 (permalink)  
Old July 16th, 2007, 03:57 PM
Authorized User
 
Join Date: Jun 2007
Location: Amman, Amman, Jordan.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naeem.net Send a message via Yahoo to naeem.net
Default


Dear Imar,
 i checked your atricle which u linked it, but seems not satisfay what i looking for.

Pls check the link below :

http://www.sackan.com/sql/add.aspx
its a simple example , the idea of it is add your name and the result will save in (dash.mdf) which located in the website in app_data folder. if you press (insert) then you will face error messege (Invalid value for key 'attachdbfilename'.).

I tested it in my local machine and its work right., but when i uploaded the project to the website is not working!!!

the connection string which i used is :
    <connectionStrings>
        <add name="dashConnectionString1" connectionString="Data Source=208.116.16.3;AttachDbFilename=|DataDirector y|/dash.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>
The ip address is of the website (www.sackan.com)

Every thing is clear?

What can i do to solve this problem????



Ali Naeem
  #8 (permalink)  
Old July 16th, 2007, 04:04 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,957
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

Quote:
quote:Originally posted by Imar
If 208.116.16.3 is not the IP of your local machine or that machine is not running SQL Server Express, you can't use AttachDbFilename. Instead, you need to attach the database to SQL Server. Then you need to setup the correct connection string to the server.
Am I missing something here? If 208.116.16.3 is not the IP of your local machine, you can't use AttachDbFilename but instead you need a proper connecting string for SQL Server.

Have you tried that? Have you tried attaching your .mdf to the server as suggested? AttachDbFilename is usually only used for SQL Server Express versions.



Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #9 (permalink)  
Old July 18th, 2007, 10:25 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Ali,

Where are you uploading this web site?
Are you uploading it to a web hosting company?

-Peter
  #10 (permalink)  
Old July 18th, 2007, 02:03 PM
Authorized User
 
Join Date: Jun 2007
Location: Amman, Amman, Jordan.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to naeem.net Send a message via Yahoo to naeem.net
Default

Dear Imar,

Have you check the link of video Learnning below:

http://www.asp.net/learn/videos/view...abid=63&id=110

Its connect web application to sql server 2005.

Ali Naeem
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0 & SQL Server 2000 / 2005 Hosting NonStopMark ASP.NET 2.0 Basics 1 January 1st, 2007 02:56 AM
ASP.Net & SQL Server chenwf2006 ASP.NET 2.0 Basics 0 December 17th, 2006 03:54 AM
ASP.NET & SQL Server 2K Stored Procedure kwilliams ASP.NET 2.0 Basics 7 May 10th, 2006 01:55 AM
Connecting to Sql server database with ASP.NET Abins ASP.NET 1.0 and 1.1 Basics 3 February 17th, 2006 06:56 PM
ASP & SQL Database ccolv Classic ASP Basics 2 July 22nd, 2003 04:27 AM



All times are GMT -4. The time now is 07:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.