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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web.config SQL Connection

Status
Not open for further replies.
Sep 29, 2002
524
US
A have a website that a friend helped me to bring up few years ago. The site was hosted in a server that also had SQL installed locally. This server was Win 2003 with SQL 2000 using SQL Auth. The server crashed and now I have temporarily moved it to a Windows 2000 while the database now resides in a separate box that has Windows 2003 and SQL 2005.

Because of the many pages that I have in the site that are using the SQL connection, I want to keep the connection in the web.config. I used several settings from but it always seemed that the web server could not connect to the database (The application tests if the database exist, if it does not, it tries to create it, which is what I see the app doing). I think the problem is more connectivity to the server. So, the question is, do I had to setup a DSN from the web server in order to connect to SQL server or can I use a DSN less connection? If I can use a DSN less connection, how can I test that the web site is really connecting to the database?

Thanks in advanced for your help,


Gladys Rodriguez
GlobalStrata Solutions
Computer Repair, Website Design and Computer Consultant
Small Business Resources
Anime, Manga and Video Games
 
Want to share your connection string? (and this is asp and ado right?)

It should look something like

"provider=sqloledb;server=YOURSERVER;database=YOURDATABASE;Integrated security=sspi"
or

"provider=sqloledb;server=YOURSERVER;database=YOURDATABASE; User ID=sa;password=myVery&^%$securePassword"
 
Damn/.. I am an idiot ..
.. I am an idiot ..
.. I am an idiot ..
.. I am an idiot .. /

This is asp.net

wrong connection string..

should be

Server=YOURSERVER;Database=YOURDB;Integrate Security=sspi

or it needs the

Server=YOURSERVER;Database=YOURDB;User Id=SOMELOGIN;Password=SOMEPASSWORD

YOu don't need the provider argument as you should be using sqlclient.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top