xp sp2 visual studio 2005 sql express 2005 bookcatalagapp

S

seacoff

Hi
I just installed Visual Studio 2005 90 day trial which comes with the
sql server express database
I want to run the sample application
2-2--5 Building a Mobile Book Catalog with Visual Studio .NET 2003
It uses the pubs db on sql express

Part of this app asks me to create a webservice which runs fine until I
try invoke it which connects to the database but in my case no matter
what I try I cant get it to connect to it.

By playing with the connection string I get errors like "named pipe
error" to "not trusted" to "not found"

I don't run windows firewall, i've edited web.config with the provider
tags. I've made sure that all the sql configuration manager protocols
are enabled. Maybe I need to start again a fresh. remove sql server
express and reinstall it.

BUT i can see the sample database pubs quite clearly on server explorer
data connections, i can list the titles table in pubs with osql
commands, I can get the sqlcmd 1> prompt up. I downloaded the SQL
Server Management Studio Express and it connected to it fine. I seems
to me that the Framework 2 cannont connect to it.

Any ideas? By the way I'm new to ms vs etc so if it's an easy answer
don't slag me off.

regards,
Sean
 
S

seacoff

More info
a.
SqlConnection myConnection = new
SqlConnection("server=192.168.5.89\\SQLEXPRESS;database=pubs;Trusted_Connection=yes");
this gives when invoking webservice
System.Net.WebException: The remote server returned an error: (404) Not
Found
b.
SqlConnection myConnection = new
SqlConnection("server=192.168.5.89;database=pubs;Trusted_Connection=yes");
this gives
(provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
c.
SqlConnection myConnection = new
SqlConnection("server=servername;database=pubs;Trusted_Connection=yes");
gives
(provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
d.
SqlConnection myConnection = new
SqlConnection("server=servername\\sqlexpress;database=pubs;Trusted_Connection=yes");
gives
System.Net.WebException: The remote server returned an error: (404) Not
Found


in cmd prompt
osql -E -S 192.168.5.89\SQLEXPRESS -d pubs -q "select * from titles"
this gives listing
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top