# (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)



## deepakgates (May 5, 2010)

Im reading this wrox beginning visual basic 2005

and in an example it says 
(“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)

firstly what is "bnewsome" what i have to use in case of local host
i got sample database pubs
but i don't know the user id and password of my sql server i just installed visual studios 2008.
-------------------------------------------
one more thing i cant establish connection with my sql server 
its the ever popular error " Named Pipes Provider: Could not open a connection to SQL Server [2]"

i just overcame tcp/ip error

----------------------------------------
also after sc query mssqlserver 

there is an error enumqueryservicesstatus openservice failed 1060
-----------------------------------------


im fed up
anyone???

---------- Post added at 01:54 PM ---------- Previous post was at 12:10 PM ----------

*well i did some research and did some code*



> imports system.data
> imports system.data.sqlclient
> public class form1
> dim objconnection as new sqlconnection("server=localhost;uid=sa;pwd=;database=pubs")
> ...




*and the result*



> an error has occurred while establishing a connection to the server.  When connecting to sql server 2005, this failure may be caused by the fact that under the default settings sql server does not allow remote connections. (provider: Named pipes provider, error: 40 - could not open a connection to sql server)



*see the attachment*


----------



## deepakgates (May 5, 2010)

*im in a deep mess*


----------



## Rollercoaster (May 10, 2010)

how are you trying to connect to the SQL instance?

sometimes '.' or '(local)' doesnt work. try to use ur computer's name (system properties > computer name tab) in addition to the instance name for e.g. normal SQL instance is named 'SQLEXPRESS' so use 'MYCOMPUTERNAME\SQLEXPRESS' and use Windows Authentication to connect 

bnewsome appears to be the server name so you have to have access to that server to connect to the sql instance on that server

if u still have problems post on forums.asp.net in the sql section


----------



## krishnandu.sarkar (May 10, 2010)

You don't need to know anything. Just inset a SQLDataSource object from the toolbar. Select the required database and the connection string will show up. Just copy paste that


----------



## deepakgates (May 16, 2010)

hey there is no sql data source in toolbox

im using vs2008 and sql server 2005 express

---------- Post added at 05:35 AM ---------- Previous post was at 04:21 AM ----------

okay i did every thing 
this is my connection string


> ("server=home-d4cb6302e5\SQLEXPRESS;database=pubs;user id=sa;password=pass123;")


 

now the error is  


> Cannot open database "pubs" requested by the login. The login failed. Login failed for user 'sa'.



even on


> ("server=home-d4cb6302e5\SQLEXPRESS;database=pubs;Integrated Security=True;")



error comes


> Cannot open database "pubs" requested by the login. The login failed. Login failed for user 'HOME-D4CB6302E5\Deepak'.


----------



## krishnandu.sarkar (May 16, 2010)

Well...Even I use VS2008. There must be something wrong. Ok there are connection tools in Toolbox. If you can't find it leave it. Just select the database and copy the connection string from the properties.


----------



## deepakgates (May 17, 2010)

no there is no connection tab

but i got it  the other way.. 
and guess what

EVERYTHING IS WORKING


----------

