Error in connecting to Database.

  • Thread starter Thread starter Nikki
  • Start date Start date
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
 
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....
 
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 ?
 
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.
 
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
 
Back
Top