Error in connecting to Database.

N

Nikki

Hi,
I am developing a small web application which connects to MS SQL Server
2000 (Developer Edition). But there is some problem in connection
string, becaz of which it is giving Error and not getting connection to
the database. Please help me to solve this problem.
Thanks,
Nikki
 
V

Vadym Stetsyak

Possible errors in the string can have:
- server name
- database name
- user name
- password

or you're specifying user credentials, where trusted connection ( SSPI ) is
expected....

Also it would greatly help, if you will tell the error, thats being returned
when connection fails....
 
N

Nikki V

Connection String which i m using is ->
string conn_str = "server=localhost; database=northwind;
Trusted_Connection=true; Integrated Security=SSPI;"

the Exception raised is:
"System.Data.SqlClient.SqlException: SQL Server does not exist or access
denied.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlCo
nnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at DatabaseAccessWebApp.WebForm1.GetData() in
c:\inetpub\wwwroot\databaseaccesswebapp\webform1.aspx.cs:line 66"

Now can u tell where am i going wrong ?
 
V

Vadym Stetsyak

are you sure that the server is running? try to connect with Query Analyzer
(QA).
If it will also fail, you can create specific user and then use his
credentials in the connection string.
 
G

Guest

Connection String which i m using is ->
string conn_str = "server=localhost; database=northwind;
Trusted_Connection=true; UserID=sa;Pwd="

Use the default user id of Sql server sa and password if any thing is set.

Raj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top