SQL Server does not exist or access denied

Hi,
I'm getting the following error when trying to view an aspx web page.

"SQL Server does not exist or access denied"

The aspx page and sql database are located on the same machine.

Here is my connection string and code:

string SQL = "SELECT * FROM tblCountry";

SqlConnection conn =new SqlConnection("Data Source=(localhost);Initial Catalog=YLCdbSQL;Integrated Security=SSPI");
SqlCommand countryLoad =new SqlCommand (SQL, conn);
SqlDataAdapter daCountry =new SqlDataAdapter(countryLoad);
DataSet dsCountry =new DataSet("YLCdbSQL");

try
{
conn.Open();
daCountry.Fill(dsCountry, "countryName");
}
finally
{
conn.Close();
}

The error highlights the conn.Open(); line. I'm using SQL Server 2000.

Any ideas what the problem might be?

Thanks

[1212 byte] By [Assimalyst] at [2007-12-16]
# 1
Shouldn't you be using this instead of the above posted code to open the connection



SqlConnection conn = new SqlConnection("Server=(localhost);Database=YLCdbSQL;Integrated Security=SSPI");


Shuja at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2
Thanks Shuja,

That's solved that one!

However, now when i try to to view the page in internet explorer the status bar reads "Detecting Proxy Settings . . ." and gets no further.

I presume this has something to do with recently upgrading my internet connection since setting up SQL server.

Any ideas on how to resolve it?

Thanks

Assimalyst at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3
You should check your Connection Settings in Internet Explorer..

Goto Tools/Internet Options, select connections Tab and click on Lan Settings Button. There you will get the Proxy settings. Check whether your Proxy Settings are correct.

Shuja at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified