Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection string issue loading asp page on godaddy

Status
Not open for further replies.

ktb916

Programmer
Jan 22, 2004
76
US
I've created a website in visual studio 2005 that access a database and allows users to view, add, change, and delete data. I've hosted the site on godaddy - I realized that i had to import my database tables into the database i created on godaddy - now i need to change my connection string to access the database on godaddy. I changed the connection string in my web.config file to point to what i believe is the correct server name and database but I keep getting various errors with the different variations of the connection string I'm using: currently the connection string looks like this

Code:
<add name="ConnectionString" connectionString="Data Source=database.db.62355448.hostedresource.com; Initial Catalog=table;Integrated Security=True;User Instance=True"
     providerName="System.Data.SqlClient" />

and I'm getting the following error

Login failed for user 'PHX3\Iusr_62355448'.

Can anyone tell me if the problem is in the connection string or is something else going wrong and how do I fix it? This is my first dynamic website.

Thanks
 
Thanks I'll check this out - also the database on godaddy has a user name and password and I'm also using loginviews and security on the webpages will i need 2 connection strings 1 to access the database and the other to access the data?
 
most likely the problem is the username and passowrd. your connection string is using integrated security, this only works locally or on a LAN. it's great of intranet (coroprate network), not internet (internet... go daddy)

go daddy should have provided you with an account to access the database, or the ability to create users in your database. the connection string would look like this
Code:
<add name="ConnectionString" connectionString="Data Source=[server name]; Initial Catalog=[database name];User ID=[the user name];Password=[the pass word]" providerName="System.Data.SqlClient" />

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Ok I changed the connection string to include user name and password to access the godaddy db - now I get this error:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.

Source Error:


[No relevant source lines]


Source File: machine.config Line: 152


 
it's looking for a connection string named LocalSqlServer. I believe this relates to forms authentication and a local sqlexpress database. there are ways to configure this to point to another database. I don't have experience with forms authentication, so I can't say for certain.

if you are not using authentication you could try removing the service all together. look into the roleManager node on web.config. I believe this is where it's configured.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks - I'm getting closer. Now my connection string is correct to access the database on godaddy but I have integrated security setup on the website also. I've used the logged in view to allow users to make changes to the data. So now I can see the data but when I try to login I get another error saying the server can't be located. I assume I have to create another connection string or somehow enable users and roles on godaddy to get it to work. Any ideas?

Thanks
 
Integrated Windows Authentication assumes the server and client are on the same network. This isn't the case with a public website. You can do this locally because your box is both the server and client (or you have private test network).

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
So how do you setup users for remote access?
 
forms authentication.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Thanks for your help - the page works well enough now but I do have another question. I'd like to execute a query on the database that would download the results to a spreadsheet on my local machine or into a spreadsheet, CSV, or text file that I can then save to my local machine. I can put together the sql statement to select the data but I'm not sure what code I need to push the reults into a downloadable format - any ideas?

 
1. start with google. there are a number of way's to download CSV data from the web. Personally i would go with a generic handler (ashx), no need for a webform and the page life cycle.

2. after you pick a method try it out, if you get hung up on a specific issue post a new thread.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top