|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
July 10th, 2007, 02:21 PM
|
Authorized User
|
|
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
July 10th, 2007, 02:56 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
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
================================================== =========
|
July 11th, 2007, 08:50 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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
|
July 13th, 2007, 02:39 PM
|
Authorized User
|
|
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
July 13th, 2007, 02:48 PM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
July 16th, 2007, 02:57 PM
|
Authorized User
|
|
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
July 16th, 2007, 03:04 PM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
July 18th, 2007, 09:25 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Ali,
Where are you uploading this web site?
Are you uploading it to a web hosting company?
-Peter
|
July 18th, 2007, 01:03 PM
|
Authorized User
|
|
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
|