Showing posts with label port. Show all posts
Showing posts with label port. Show all posts

Thursday, March 22, 2012

Connectivity issue - SQLServer not listening on port 1433/ms-sql-s

Hi. I'm a SQL Server novice, so apologies if any of this sounds simple.

I am running Windows XP SP2, and have just installed SQLServer 2000. I
need another application to connect to SQLServer, and am specifying it
to do so via localhost:1433, but keep getting an error whenever I try
doing so saying it cannot connect to the database. A colleague of mine
has the exact same set up on his machine, and he can connect to SQL
Server fine. Running 'netstat -a' at the command line on his machine
reveals that the system is listening to port 1433/ms-sql-s. Running
netstat on my machine shows that the system is not listening to
1433/ms-sql-ms. I have checked in Network Config in SQLServer
Enterprise Manager, and TCP/IP is set to be using 1433.

To confirm this, my application can connect over the network to my
colleague's SQL Server. but he cannot connect over the network to mine.

So I'm pretty sure the issue is related to this 1433/ms-sql-s problem.
Does anyone know how to resolve this? Many thanks.I just installed SQL Server Service Pack 3, and the problem is now
resolved. Perhaps it was related to the Slammer worm.

ConnectionString property has not been initialized

My IT dept set up an SQL db on a server for me and I am connected to it through a port. They told me I had to create my tables through an MS Access adp, which I have done. I am using VWD Express and am trying to create a login page using usernames and pw's from a db table. I am connected (at least the db Explorer tab shows I am) to the MS Access adp and can drop a GridView from my Employees table from it onto a page and get results. I keep getting the "ConnectionString property not initialized" error message pointing to my sqlConn.Open() statement and cannot figure out why. I have looked at hundreds of posts but can't seem to find anything that works. If someone could point me to some post or website that could explain connecting to a SQL db through a port or whatever you think I need to learn to get this fixed I would appreciate it.
Web config:

<configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<appSettings/>

<connectionStrings>

<addname="ASPNETDB"connectionString="Description=Training;DRIVER=SQL Server;SERVER=USAWVAS27;UID=usx14611;APP=Microsoft? Visual Studio? 2005;WSID=983QD21;Network=DBMSSOCN;Address=USAWVAS27,3180;Trusted_Connection=Yes"providerName="System.Data.Odbc"/>

</connectionStrings>

<system.web>

<authenticationmode="Forms" />

<authorization>

<denyusers="?" />

</authorization>

<customErrorsmode="Off" />

</system.web>

</configuration>
My login.aspx page

<%@.PageLanguage="VB"debug="true"%>

<%@.ImportNamespace="System.Data.SqlClient" %>

<%@.ImportNamespace="System.Configuration.ConfigurationManager" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

ProtectedSub LoginUser(ByVal sAsObject,ByVal eAs EventArgs)

Dim blnAuthenticateAsBoolean = Authenticate(username.Text, password.Text)

If blnAuthenticateThen

FormsAuthentication.RedirectFromLoginPage(username.Text,False)

EndIf

EndSub

Function Authenticate(ByVal strUsernameAsString,ByVal strPasswordAsString)AsBoolean

Dim strConnectionAsString = ConfigurationManager.AppSettings("ASPNETDB")

Tried this code as well
Dim sqlConn As New SqlConnection(ConfigurationManager.AppSettings("ASPNETDB"))

Dim sqlConnAsNew SqlConnection(strConnection)

Dim sqlCmdAs SqlCommand

Dim sqlDRAs SqlDataReader

Dim userFoundAsBoolean

sqlCmd =New SqlCommand("SELECT * FROM Employees " & _

"WHERE username='" & strUsername &" ' AND password='" & strPassword &"'", sqlConn)

sqlConn.Open()

sqlDR = sqlCmd.ExecuteReader()

userFound = sqlDR.Read()

sqlDR.Close()

Return userFound

EndFunction

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<p>Username:<asp:TextBoxID="username"runat="server"></asp:TextBox><br/>

<br/>

<p>Password:<asp:TextBoxID="password"runat="server"></asp:TextBox><br/>


<br/>

<asp:ButtonID="btnSubmit"runat="server"Text="Login"OnClick="LoginUser"/> </div>

</form>

</body>

</html>
Thanks

Still trying to figure this out. I can't believe that there isn't some resource(book, website..) out their that explains these types of errors. My IT dept insists that the database was set up correctly to allow me to use a table with usernames and pw's to build a login page but no matter what I try I get the same message. There doesn't seem to be any reason whatsoever for it to not work. I'm not even getting errors when I debug, just when I enter a login/password onto my login.aspx page and submit.
I removed my database connection and reconnected which gave me this as a new connection string:

<connectionStrings>

<addname="connString"connectionString="Data Source=USAWVAS27;Initial Catalog=MaterialsTraining;Integrated Security=False"/>

</connectionStrings>
Anybody have any ideas?
Thanks,
Toni

|||I haven't done this in VB, but here's what I think it should be based on how C# does it.
Looks like this:

Dim strConnectionAsString = ConfigurationManager.AppSettings("ASPNETDB")

Should be this:

Dim strConnectionAsString = ConfigurationManager.ConnectionStrings("ASPNETDB").ConnectionString

|||

Finally got this figured out so thought I'd share it. Thanks to those who responded with suggestions. It didn't like "DRIVER" and "Description" in my original system generated connection string, I'm assuming because it is an SQL database (?)
<connectionStrings>

<addname="ASPNETDB"connectionString="DataSource=Training;server=USAWVAS27;wsid=983QD21;network=DBMSSOCN;address=USAWVAS27,3180;trusted_connection=Yes"/>

</connectionStrings>

|||Hello, am getting a similar problem to the one you had. But I stilldon't know how to fix it. I only get the error when am runnign thelogin.It says the conn is not initialized. It's been giving me aheadache for 2 days now. Please help if possible
Protected Sub loginBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles loginBtn.Click
Dim strConnection As String = ConfigurationManager.AppSettings("sups")
Dim conn As New SqlConnection(strConnection)
Dim cmd As SqlCommand
Dim read As SqlDataReader
conn.Open()
The web.config file is like this...
<configuration>
<appSettings/>
<connectionStrings>
<add name="sups"connectionString="server=localhost;Trusted_Connection=true;database=sups;uid=abcd; pwd=abcd;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
Where am I going wrong? Thanks a lot
|||I fixed this error with this if anyone is having problems

Dim sSQL As String
sSQL = "SELECT * FROM optionitems WHERE id=" & ID.ToString


Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("cre8StoreConnectionString").ConnectionString)
Dim cmd As New SqlCommand(sSQL)
conn.Open()
cmd.Connection = conn

Dim reader As SqlDataReader = cmd.ExecuteReader

the problem I was having to genrate this error was caused because I was using the datareader without assigning a connection to the SQLcommand object.

Sunday, March 11, 2012

Connection to SQLserver

We have a server running SQL2000 which I am trying to get access to via the
internet. I have used the port forwarding setup on our router/firewall to
transfer all traffic on port 1433 to the server 192.168.0.99. I cannot get a
connection as it states the server was not found or it was denied access.
I have a similar method of access to a couple of Personal Addition setups
off site and I can get a connection.
What is slightly unusual is that I have two connections to the internet one
leased line where I can't get access to the firewall and a broadband where I
do. Both are running NAT. Is this an area to check
Thanks for a pointers you can give me
Ian
"Ian Rudge" <Ian.Rudge@.shaw.co.uk> wrote in message
news:Opx2sOvmEHA.556@.tk2msftngp13.phx.gbl...
> We have a server running SQL2000 which I am trying to get access to via
the
> internet. I have used the port forwarding setup on our router/firewall to
> transfer all traffic on port 1433 to the server 192.168.0.99. I cannot get
a
> connection as it states the server was not found or it was denied access.
> I have a similar method of access to a couple of Personal Addition setups
> off site and I can get a connection.
> What is slightly unusual is that I have two connections to the internet
one
> leased line where I can't get access to the firewall and a broadband where
I
> do. Both are running NAT. Is this an area to check
Maybe. There are a lot of variables in getting this to work properly. Check
this article along with links for troubleshooting this setup
http://support.microsoft.com/default...b;en-us;287932
BTW, I hope that was only a fictitious external IP address for your
server...
Steve
|||Thank you for pointers and I will start my search from that.
The IP address is fictional but as it is internal in the 192.168... range I
thought you couldn't get to it or should I panic?
Thx
Ian
"Steve Thompson" <stevethompson@.nomail.please> wrote in message
news:OGpa1X0mEHA.3876@.TK2MSFTNGP15.phx.gbl...
> "Ian Rudge" <Ian.Rudge@.shaw.co.uk> wrote in message
> news:Opx2sOvmEHA.556@.tk2msftngp13.phx.gbl...
> the
> a
> one
> I
> Maybe. There are a lot of variables in getting this to work properly.
> Check
> this article along with links for troubleshooting this setup
> http://support.microsoft.com/default...b;en-us;287932
> BTW, I hope that was only a fictitious external IP address for your
> server...
> Steve
>
|||You're right, I should have recognized that range ;) No need to panic, it
goes without saying that you need a good firewall and isolation from the
"outside".
Steve
"Ian Rudge" <Ian.Rudge@.shaw.co.uk> wrote in message
news:%23rcxs97mEHA.3628@.TK2MSFTNGP09.phx.gbl...
> Thank you for pointers and I will start my search from that.
> The IP address is fictional but as it is internal in the 192.168... range
I[vbcol=seagreen]
> thought you couldn't get to it or should I panic?
> Thx
> Ian
> "Steve Thompson" <stevethompson@.nomail.please> wrote in message
> news:OGpa1X0mEHA.3876@.TK2MSFTNGP15.phx.gbl...
to[vbcol=seagreen]
access.[vbcol=seagreen]
setups
>
|||I think I have found my answer. If I want to connect from outside, the
gateway for the SQLServer machine must point to the Broadband router not the
leased line one
Thx
for the help
"Steve Thompson" <stevethompson@.nomail.please> wrote in message
news:OEGQIECnEHA.1236@.TK2MSFTNGP09.phx.gbl...
> You're right, I should have recognized that range ;) No need to panic, it
> goes without saying that you need a good firewall and isolation from the
> "outside".
> Steve
> "Ian Rudge" <Ian.Rudge@.shaw.co.uk> wrote in message
> news:%23rcxs97mEHA.3628@.TK2MSFTNGP09.phx.gbl...
> I
> to
> access.
> setups
>

Wednesday, March 7, 2012

Connection to MSDE

Hi,
Is it possible to connect to a MSDE engine
from Management Studio 2005 ?
With tcpview, I didn't see a port which it listens
Thanks in advance
hi,
astalavista wrote:
> Hi,
> Is it possible to connect to a MSDE engine
> from Management Studio 2005 ?
> With tcpview, I didn't see a port which it listens
>
yes, you can connect from Management Studio to MSDE database...
MSDE installs by default disabling remote connections and network protocols,
thus tcp/ip protocol is not enable and local connections will be available
via shared memory only...
to enable remote connections and tcp/ip protocol you have to run the Server
Network Utility (svrnecn.exe) and enable the required protocol..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
-- remove DMO to reply
|||Thank you very much ...
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> a crit dans le message de
news: 5ccv2sF30j4u5U1@.mid.individual.net...
> hi,
> astalavista wrote:
> yes, you can connect from Management Studio to MSDE database...
> MSDE installs by default disabling remote connections and network
> protocols, thus tcp/ip protocol is not enable and local connections will
> be available via shared memory only...
> to enable remote connections and tcp/ip protocol you have to run the
> Server Network Utility (svrnecn.exe) and enable the required protocol..
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz http://italy.mvps.org
> DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
> -- remove DMO to reply
>

Saturday, February 25, 2012

Connection String with Named Instance and Port?

I am trying to create a SQL Server 2000 and 2005-friendly connection
string that will allow me to connect to a named instance on a
non-standard port. I can't get the syntax right, can anyone show an
example?
Thanks.
For data source, use YourServer\YourNamedInstance then a
comma followed by the port number - e.g.
Data Source=YourServer\NamedInstance,1433;
-Sue
On 23 Mar 2006 06:38:16 -0800, bradwiseathome@.hotmail.com
wrote:

>I am trying to create a SQL Server 2000 and 2005-friendly connection
>string that will allow me to connect to a named instance on a
>non-standard port. I can't get the syntax right, can anyone show an
>example?
>Thanks.

Connection String with Named Instance and Port?

I am trying to create a SQL Server 2000 and 2005-friendly connection
string that will allow me to connect to a named instance on a
non-standard port. I can't get the syntax right, can anyone show an
example?
Thanks.For data source, use YourServer\YourNamedInstance then a
comma followed by the port number - e.g.
Data Source=YourServer\NamedInstance,1433;
-Sue
On 23 Mar 2006 06:38:16 -0800, bradwiseathome@.hotmail.com
wrote:
>I am trying to create a SQL Server 2000 and 2005-friendly connection
>string that will allow me to connect to a named instance on a
>non-standard port. I can't get the syntax right, can anyone show an
>example?
>Thanks.

Connection String with Named Instance and Port?

I am trying to create a SQL Server 2000 and 2005-friendly connection
string that will allow me to connect to a named instance on a
non-standard port. I can't get the syntax right, can anyone show an
example?
Thanks.For data source, use YourServer\YourNamedInstance then a
comma followed by the port number - e.g.
Data Source=YourServer\NamedInstance,1433;
-Sue
On 23 Mar 2006 06:38:16 -0800, bradwiseathome@.hotmail.com
wrote:

>I am trying to create a SQL Server 2000 and 2005-friendly connection
>string that will allow me to connect to a named instance on a
>non-standard port. I can't get the syntax right, can anyone show an
>example?
>Thanks.

Sunday, February 12, 2012

Connection problems to SQL2005 with odbc using port 1733

Hi,
I'm trying to connect to a SQL2005 server inside a firewall from another
Windows2003 server that is placed in DMZ. Both servers is hosted by our ISP
but they can't seem to find the problem.
Because the sqlserver is used by many companies we have to communicate with
the sql server on port 1733 and not default port 1433. Therefore I have made
an alias for the connection that I have called sql2005 that is set up to use
port 1733.
After configuring the odbc connection everything works, but after a while
(eg. if I restart my own computer) I reconnect to the server and I get "Sql
server does not excist or access denied". If I then enters the client
configuration and spesify port 1733 again, it works. I looks like the odbc
connection doesn't "remember" the port that is spesified.
Anybody know how to specify a custom port that the odbc connection can
remember?
Or how to specify port in a connectionstring for a asp web application?
In advance thanks a lot for your help!!
Kind regards,
Jon Haakon Ariansen
Does something like "Datasource=127.0.0.1,1733" work for you?
"Jon Haakon Ariansen" <jona@.spama.no> wrote in message
news:%23$tfZHJ3GHA.2196@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I'm trying to connect to a SQL2005 server inside a firewall from another
> Windows2003 server that is placed in DMZ. Both servers is hosted by our
> ISP but they can't seem to find the problem.
> Because the sqlserver is used by many companies we have to communicate
> with the sql server on port 1733 and not default port 1433. Therefore I
> have made an alias for the connection that I have called sql2005 that is
> set up to use port 1733.
> After configuring the odbc connection everything works, but after a while
> (eg. if I restart my own computer) I reconnect to the server and I get
> "Sql server does not excist or access denied". If I then enters the client
> configuration and spesify port 1733 again, it works. I looks like the odbc
> connection doesn't "remember" the port that is spesified.
> Anybody know how to specify a custom port that the odbc connection can
> remember?
> Or how to specify port in a connectionstring for a asp web application?
> In advance thanks a lot for your help!!
> Kind regards,
> Jon Haakon Ariansen
>

Connection problems to SQL2005 with odbc using port 1733

Hi,
I'm trying to connect to a SQL2005 server inside a firewall from another
Windows2003 server that is placed in DMZ. Both servers is hosted by our ISP
but they can't seem to find the problem.
Because the sqlserver is used by many companies we have to communicate with
the sql server on port 1733 and not default port 1433. Therefore I have made
an alias for the connection that I have called sql2005 that is set up to use
port 1733.
After configuring the odbc connection everything works, but after a while
(eg. if I restart my own computer) I reconnect to the server and I get "Sql
server does not excist or access denied". If I then enters the client
configuration and spesify port 1733 again, it works. I looks like the odbc
connection doesn't "remember" the port that is spesified.
Anybody know how to specify a custom port that the odbc connection can
remember?
Or how to specify port in a connectionstring for a asp web application'
In advance thanks a lot for your help!!
Kind regards,
Jon Haakon AriansenDoes something like "Datasource=127.0.0.1,1733" work for you?
"Jon Haakon Ariansen" <jona@.spama.no> wrote in message
news:%23$tfZHJ3GHA.2196@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I'm trying to connect to a SQL2005 server inside a firewall from another
> Windows2003 server that is placed in DMZ. Both servers is hosted by our
> ISP but they can't seem to find the problem.
> Because the sqlserver is used by many companies we have to communicate
> with the sql server on port 1733 and not default port 1433. Therefore I
> have made an alias for the connection that I have called sql2005 that is
> set up to use port 1733.
> After configuring the odbc connection everything works, but after a while
> (eg. if I restart my own computer) I reconnect to the server and I get
> "Sql server does not excist or access denied". If I then enters the client
> configuration and spesify port 1733 again, it works. I looks like the odbc
> connection doesn't "remember" the port that is spesified.
> Anybody know how to specify a custom port that the odbc connection can
> remember?
> Or how to specify port in a connectionstring for a asp web application'
> In advance thanks a lot for your help!!
> Kind regards,
> Jon Haakon Ariansen
>