SQL Server does not exist or access denied

chime

Member
Joined
Jul 12, 2005
Messages
22
Location
wexford, Ireland
Programming Experience
3-5
I have just started to use SQL SERVER for the first time today.

I can set up a dataadapter and connection string in vb .net and pull down data

But when I try to do it in code it doesn't work and I get the following error
"SQL Server does not exist or access denied"


I am sure this is something simple but never having used SQL Server before I am not sure wht to try next

I have tried the connection strings from connectionstring.com - SQL Server - SqlConnection (.net)
even when i try it with username sa

VB.NET:
 Try 

			' "Server=KARLDUGGAN;Database=jintsu;Trusted_Connection=True;" 

			' Run the select statement to collect data to fill the dataset
			SqlSelectCommand1.CommandText = "SELECT ClientID, EntityID " & _
													"FROM Entity"
			DataSetClientID.Clear()
			' Fill the dataset
			SqlDataAdapterClientID.Fill(DataSetClientID)

			' Display the data in the datasource
			DropDownListClientID.DataSource = DataSetClientID
			DropDownListClientID.DataBind()

		Catch ex As Exception
		End Try

	End Sub
 
It is probably in this: "Server=KARLDUGGAN"

if you have a default instance of sql server then type "SERVER=(local)" or instad of (local) write your computer name, but if you have a named instance of an sql server then use: "Server=computername\instancename"
 
Hi MainicCW

Thanks for the reply,

I am access this on another computer in another office across the network
There is no firewall to cross

The thing that confuses me is how come I can connect using the dataadapter and preview the data but it won't run in the code


Thanks
 
With SQL authentication

ConnString= "Data Source=SERVER;Initial Catalog=DATABASE;User Id=USERNAME;Password=PASSWORD"

NT authentication
ConnString = "Data Source=SERVER;Initial Catalog=DATABASE;Integrated security=SSPI"

 
Back
Top