Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 05-05-2010, 07:24 PM   #1 (permalink)
Right Off the Assembly Line
 
deepakgates's Avatar
 
Join Date: May 2008
Location: Home
Posts: 36
Default (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)


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

Quote:
imports system.data
imports system.data.sqlclient
public class form1
dim objconnection as new sqlconnection("server=localhost;uid=sa;pwd=;databa se=pubs")
dim objdataadapter as new sqldataadapter()
dim objdataset as new dataset()
private sub form1_load(byval sender as object, byval e as system.eventargs) handles me.load
' set the selectcommand properties...
Objdataadapter.selectcommand = new sqlcommand()
objdataadapter.selectcommand.connection = objconnection
objdataadapter.selectcommand.commandtext = "select au_lname, au_fname, title, price " & "from authors " & "join titleauthor on authors.au_id = titleauthor.au_id " & "join titles on titleauthor.title_id = titles.title_id " & _
"order by au_lname, au_fname"
objdataadapter.selectcommand.commandtype = commandtype.text
' open the database connection...
Objconnection.open()
' fill the dataset object with data...
Objdataadapter.fill(objdataset, "authors")
' close the database connection...
Objconnection.close()
' set the datagridview properties to bind it to our data...
Grdauthortitles.autogeneratecolumns = true
grdauthortitles.datasource = objdataset
grdauthortitles.datamember = "authors"
' clean up
objdataadapter = nothing
objconnection = nothing
end sub
end class

and the result

Quote:
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
Attached Images
File Type: jpg prob.jpg (97.4 KB, 2 views)

Last edited by deepakgates; 05-05-2010 at 06:14 PM.
deepakgates is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 05-05-2010, 07:26 PM   #2 (permalink)
Right Off the Assembly Line
 
deepakgates's Avatar
 
Join Date: May 2008
Location: Home
Posts: 36
Default Re: (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)

im in a deep mess
deepakgates is offline  
Old 10-05-2010, 02:38 PM   #3 (permalink)
-The BlacKCoaT Operative-
 
Rollercoaster's Avatar
 
Join Date: Mar 2005
Location: Dehradun, India
Posts: 1,205
Default Re: (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)

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
__________________
--------------------------------------------
Holding my last breath, safe inside myself.....
--------------------------------------------
I dont use my computer. I misuse it- रोलरकोस्टर
Rollercoaster is offline  
Old 10-05-2010, 07:07 PM   #4 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default Re: (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)

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
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is offline  
Old 16-05-2010, 11:05 AM   #5 (permalink)
Right Off the Assembly Line
 
deepakgates's Avatar
 
Join Date: May 2008
Location: Home
Posts: 36
Default Re: (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)

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
Quote:
("server=home-d4cb6302e5\SQLEXPRESS;database=pubs;user id=sa;password=pass123;")

now the error is
Quote:
Cannot open database "pubs" requested by the login. The login failed. Login failed for user 'sa'.
even on
Quote:
("server=home-d4cb6302e5\SQLEXPRESS;database=pubs;Integrated Security=True;")
error comes
Quote:
Cannot open database "pubs" requested by the login. The login failed. Login failed for user 'HOME-D4CB6302E5\Deepak'.
deepakgates is offline  
Old 16-05-2010, 09:06 PM   #6 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Default Re: (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)

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.
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is offline  
Old 17-05-2010, 03:46 PM   #7 (permalink)
Right Off the Assembly Line
 
deepakgates's Avatar
 
Join Date: May 2008
Location: Home
Posts: 36
Default Re: (“server=bnewsome;database=pubs;user id=sa;password=!p@ssw0rd!;”)

no there is no connection tab

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

EVERYTHING IS WORKING
deepakgates is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Charan
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 03:17 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2