473,396 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

trying to connect to SQL DB

123 100+
I am trying to connect to a SQL DB and I have owner access, but I am unable to connect.

Here is my connectionstring:



Dim connectionString As String = _
"Data Source=db server name" & _
"Initial Catalog=name;Integrated Security=true"
Dim theDatabase As New SqlClient.SqlConnection(connectionString)



theDatabase.Open()


and the error I get is:

(Priovider: Named Pipes Provider, Error: 40 - could not open a connection to SQL server)
the details state that under default settings SQL server does not allow remote connection.

I've tried everything I can think of...any ideas?

thanks.
Jun 21 '07 #1
8 1601
I am trying to connect to a SQL DB and I have owner access, but I am unable to connect.

Here is my connectionstring:

Expand|Select|Wrap|Line Numbers
  1.  
  2.         Dim connectionString As String = _
  3.             "Data Source=db server name" & _
  4.             "Initial Catalog=name;Integrated Security=true"
  5.         Dim theDatabase As New SqlClient.SqlConnection(connectionString)
  6.  
  7.  
  8.  
  9.         theDatabase.Open()
  10.  
and the error I get is:

(Priovider: Named Pipes Provider, Error: 40 - could not open a connection to SQL server)
the details state that under default settings SQL server does not allow remote connection.

I've tried everything I can think of...any ideas?

thanks.
Tried putting a space or semicolon behind the "Data Source=db server name" just before the last " ? Or is this just a typo..

Might be a stupid guess but i've done worse.

Jasper
Jun 21 '07 #2
Newbie19
123 100+
I did the semi colon like this:

Dim connectionString As String = _
"Data Source=san-sql.corp.advertising.com" & _
"Initial Catalog=Ontimetesting;Integrated Security=true;"
Dim theDatabase As New SqlClient.SqlConnection(connectionString)

but I still get the error. Could there be a line that I need in the App.config file to verify the connection is trusted or something? I know in an ASP/SQL site I made once that all I need was a line that stated idenity impersonator = true or something..I'm not too familiar with connecting an application in VB to a database (first time).

Thanks.
Jun 21 '07 #3
I did the semi colon like this:

Dim connectionString As String = _
"Data Source=san-sql.corp.advertising.com" & _
"Initial Catalog=Ontimetesting;Integrated Security=true;"
Dim theDatabase As New SqlClient.SqlConnection(connectionString)

but I still get the error. Could there be a line that I need in the App.config file to verify the connection is trusted or something? I know in an ASP/SQL site I made once that all I need was a line that stated idenity impersonator = true or something..I'm not too familiar with connecting an application in VB to a database (first time).

Thanks.
I think you're just bothered by a typo. Your string (without line breaks _ ) would now look like
"Data Source=san-sql.corp.advertising.comInitial Catalog=Ontimetesting;Integrated Security=true;"

I'm guessing a space between the advertising.com and Initial Catalog would do the trick. If that isn't the prob, I don't know much of connecting to DB's either, so I can't help you any further... Maybe someone else?
Jun 21 '07 #4
Newbie19
123 100+
Thanks for the help anyway, I did catch on typo, but still no luck.
Jun 21 '07 #5
Newbie19
123 100+
I don't know if this is any help to you all out there, but I ran a debug and found this:

Error for : theDatabase.Open()



EXECUTE permission denied on object 'sp_sdidebug', database 'master', owner 'dbo'
Jun 21 '07 #6
Newbie19
123 100+
okay I added the Imports System.Data.SqlClient.SqlException and get this error
: Line 1: Incorrect syntax near '.'.

Here is the start of my code (connection wise)...I'm new to this type of VB application:

Imports System.Data.SqlClient
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient.SqlException



Public Class Form1


Private Sub adddefectbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles adddefectbutton.Click
'When Clicked the Data will be insterted into the database.

'-------Connect to the Database

Dim connectionString As String = "Data Source=san-sql.corp.advertising.com;Initial Catalog=Ontimetesting;Integrated Security=true;"

Dim theDatabase As New SqlClient.SqlConnection(connectionString)



theDatabase.Open()
Jun 21 '07 #7
pureenhanoi
175 100+
I am trying to connect to a SQL DB and I have owner access, but I am unable to connect.

Here is my connectionstring:



Dim connectionString As String = _
"Data Source=db server name" & _
"Initial Catalog=name;Integrated Security=true"
Dim theDatabase As New SqlClient.SqlConnection(connectionString)



theDatabase.Open()


and the error I get is:

(Priovider: Named Pipes Provider, Error: 40 - could not open a connection to SQL server)
the details state that under default settings SQL server does not allow remote connection.

I've tried everything I can think of...any ideas?

thanks.
you are trying connect to remote SQL-Server and receive error that SQL-Server does not allow remote connection. I think thats the security of this server does not allow u connect to (at least through remote way). If u trusted about this server, so re-config it to allow remote access.
Jun 22 '07 #8
Newbie19
123 100+
you are trying connect to remote SQL-Server and receive error that SQL-Server does not allow remote connection. I think thats the security of this server does not allow u connect to (at least through remote way). If u trusted about this server, so re-config it to allow remote access.

Make sense, actually I was informed yesterday that the security level on that one SQL Server is extremely high.

Thanks.
Jun 22 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Subra Mallampalli | last post by:
Hi, I am trying to connect over HTTPS using a client certificate. I am able to connect fine when using IE. From my application, however, I get the following error: The underlying connection...
1
by: pemigh | last post by:
I'm almost done with an application, and trying to lock it down tightly. But I still want users to be able to point to a new location for the data file. The code below fires off to detect and...
5
by: kkddrpg | last post by:
the database looks like this the database is called username_tpp (not really just using username as a sub) the table is called home it has field 1 : varchar(50) | latin1_swedish_ci | no...
0
by: Marty | last post by:
As said in the title I am trying to connect to a .WK1 file. Here is my code so far: If (.ShowDialog() = Windows.Forms.DialogResult.OK) Then strFilePath =...
5
by: Alan Silver | last post by:
Hello, Server configuration: Windows 2003 Server SP2 SQL Server 2000 SP4 ..NET v2.0.50727 just built up a new server using the same configuration as my current one. I even used the same CDs...
11
by: =?Utf-8?B?c2NodXJzdDMw?= | last post by:
Hi, I am currently trying to get back into ASP and have begun looking at an old webpage I developed some years ago, it was fully functional back in 2002 and I had it up and running with no...
1
by: danfolkes | last post by:
Hey Everyone, I am trying to send repeated messages from a "Node" to a "Server". It works the first time I send the from the Node to Server, but after that it either errors, or does not do...
6
by: SRK | last post by:
Hi, I have installed free TDS ODBC driver on Linux and from there I am trying to connect to MS SQLSERVER installed on Windows machine. But it gives me following error - tsql -H ps6312 -p 1433...
11
by: arty | last post by:
i've been trying to connect to a db using this code: #!"C:\xampp\perl\strawberry\perl\bin\perl.exe" use DBI; use strict; use warnings; print "Content-type: text/html \n\n"; #HTTP HEADER my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.