Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Monday, March 26, 2012

Pooling issues

We have been fighting with this for some time now. The web group keeps
setting the max connections in their connection strings to "2500" yes you
read that correct....that seems a little insane. BUT, we've witnesses the
site stop working when they lower it. The behavior we are seeing would
point at the pool manager not queuing requests and servicing them properly
when a connection becomes available.
Watching the activity monitor in SQL2005 we rarely see more than 5-6
connections in a runnable state. Although there are many more sleeping.
All the code in the web apps and webservices has been exhaustively gone over
to ensure connections are being released and in a timely manner. What else
could we be missing?OK so sleeping processes are only waiting for locks and are actually
busy....I misready something there. BUT why do some of these show wait
times of zero when the last batch value is sometimes a day ago? If it
hasn't run something since yesterday shouldn't the connection be gone by
now?
"Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
news:%23zJKeBrbGHA.3908@.TK2MSFTNGP02.phx.gbl...
> We have been fighting with this for some time now. The web group keeps
> setting the max connections in their connection strings to "2500" yes you
> read that correct....that seems a little insane. BUT, we've witnesses
> the site stop working when they lower it. The behavior we are seeing
> would point at the pool manager not queuing requests and servicing them
> properly when a connection becomes available.
> Watching the activity monitor in SQL2005 we rarely see more than 5-6
> connections in a runnable state. Although there are many more sleeping.
> All the code in the web apps and webservices has been exhaustively gone
> over to ensure connections are being released and in a timely manner.
> What else could we be missing?
>|||A connection will not disappear unless the application terminates the
connection. So, if the application that issued the batch several days ago
is still hanging around without anything to do, it is still going to have a
connection to your server.
You have a problem with your connection pool settings and management. I've
worked on websites that are servicing over 1 million CONCURRENT users with
database requests and they have their pools set to 15.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
news:%23MprjJrbGHA.2068@.TK2MSFTNGP02.phx.gbl...
> OK so sleeping processes are only waiting for locks and are actually
> busy....I misready something there. BUT why do some of these show wait
> times of zero when the last batch value is sometimes a day ago? If it
> hasn't run something since yesterday shouldn't the connection be gone by
> now?
>
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:%23zJKeBrbGHA.3908@.TK2MSFTNGP02.phx.gbl...
>|||"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:O8kKlhrbGHA.1264@.TK2MSFTNGP05.phx.gbl...
>A connection will not disappear unless the application terminates the
>connection. So, if the application that issued the batch several days ago
>is still hanging around without anything to do, it is still going to have a
>connection to your server.
> You have a problem with your connection pool settings and management.
> I've worked on websites that are servicing over 1 million CONCURRENT users
> with database requests and they have their pools set to 15.
This is what I keep hearing...though I haven't heard any ideas on how to
get there. I'm nearly 100% sure we are not leaking connections. But the
webservices choke and quit responding when the pool size is reduced. It
doesn't even seem to queue requests for the timeout period.....just stops
responding altogether.

> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:%23MprjJrbGHA.2068@.TK2MSFTNGP02.phx.gbl...
>|||Is that with authentication being unique per user? Or with a common user
throughout the website? I could certainly believe that with a unique user
authentication scenario but if everyone hitting that site is being connected
with the same credentials then I can't see how 15 connections would ever
service all 1 million people. Call me skeptic, (and new to this) but that
is hard to accept. I knew we had a problem but dang, you make me want to
cry .....
"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:O8kKlhrbGHA.1264@.TK2MSFTNGP05.phx.gbl...
>A connection will not disappear unless the application terminates the
>connection. So, if the application that issued the batch several days ago
>is still hanging around without anything to do, it is still going to have a
>connection to your server.
> You have a problem with your connection pool settings and management.
> I've worked on websites that are servicing over 1 million CONCURRENT users
> with database requests and they have their pools set to 15.
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:%23MprjJrbGHA.2068@.TK2MSFTNGP02.phx.gbl...
>

Pooling issues

We have been fighting with this for some time now. The web group keeps
setting the max connections in their connection strings to "2500" yes you
read that correct....that seems a little insane. BUT, we've witnesses the
site stop working when they lower it. The behavior we are seeing would
point at the pool manager not queuing requests and servicing them properly
when a connection becomes available.
Watching the activity monitor in SQL2005 we rarely see more than 5-6
connections in a runnable state. Although there are many more sleeping.
All the code in the web apps and webservices has been exhaustively gone over
to ensure connections are being released and in a timely manner. What else
could we be missing?OK so sleeping processes are only waiting for locks and are actually
busy....I misready something there. BUT why do some of these show wait
times of zero when the last batch value is sometimes a day ago? If it
hasn't run something since yesterday shouldn't the connection be gone by
now?
"Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
news:%23zJKeBrbGHA.3908@.TK2MSFTNGP02.phx.gbl...
> We have been fighting with this for some time now. The web group keeps
> setting the max connections in their connection strings to "2500" yes you
> read that correct....that seems a little insane. BUT, we've witnesses
> the site stop working when they lower it. The behavior we are seeing
> would point at the pool manager not queuing requests and servicing them
> properly when a connection becomes available.
> Watching the activity monitor in SQL2005 we rarely see more than 5-6
> connections in a runnable state. Although there are many more sleeping.
> All the code in the web apps and webservices has been exhaustively gone
> over to ensure connections are being released and in a timely manner.
> What else could we be missing?
>|||A connection will not disappear unless the application terminates the
connection. So, if the application that issued the batch several days ago
is still hanging around without anything to do, it is still going to have a
connection to your server.
You have a problem with your connection pool settings and management. I've
worked on websites that are servicing over 1 million CONCURRENT users with
database requests and they have their pools set to 15.
--
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
news:%23MprjJrbGHA.2068@.TK2MSFTNGP02.phx.gbl...
> OK so sleeping processes are only waiting for locks and are actually
> busy....I misready something there. BUT why do some of these show wait
> times of zero when the last batch value is sometimes a day ago? If it
> hasn't run something since yesterday shouldn't the connection be gone by
> now?
>
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:%23zJKeBrbGHA.3908@.TK2MSFTNGP02.phx.gbl...
>> We have been fighting with this for some time now. The web group keeps
>> setting the max connections in their connection strings to "2500" yes you
>> read that correct....that seems a little insane. BUT, we've witnesses
>> the site stop working when they lower it. The behavior we are seeing
>> would point at the pool manager not queuing requests and servicing them
>> properly when a connection becomes available.
>> Watching the activity monitor in SQL2005 we rarely see more than 5-6
>> connections in a runnable state. Although there are many more sleeping.
>> All the code in the web apps and webservices has been exhaustively gone
>> over to ensure connections are being released and in a timely manner.
>> What else could we be missing?
>|||"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:O8kKlhrbGHA.1264@.TK2MSFTNGP05.phx.gbl...
>A connection will not disappear unless the application terminates the
>connection. So, if the application that issued the batch several days ago
>is still hanging around without anything to do, it is still going to have a
>connection to your server.
> You have a problem with your connection pool settings and management.
> I've worked on websites that are servicing over 1 million CONCURRENT users
> with database requests and they have their pools set to 15.
This is what I keep hearing...though I haven't heard any ideas on how to
get there. I'm nearly 100% sure we are not leaking connections. But the
webservices choke and quit responding when the pool size is reduced. It
doesn't even seem to queue requests for the timeout period.....just stops
responding altogether.
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:%23MprjJrbGHA.2068@.TK2MSFTNGP02.phx.gbl...
>> OK so sleeping processes are only waiting for locks and are actually
>> busy....I misready something there. BUT why do some of these show wait
>> times of zero when the last batch value is sometimes a day ago? If it
>> hasn't run something since yesterday shouldn't the connection be gone by
>> now?
>>
>> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
>> news:%23zJKeBrbGHA.3908@.TK2MSFTNGP02.phx.gbl...
>> We have been fighting with this for some time now. The web group keeps
>> setting the max connections in their connection strings to "2500" yes
>> you read that correct....that seems a little insane. BUT, we've
>> witnesses the site stop working when they lower it. The behavior we are
>> seeing would point at the pool manager not queuing requests and
>> servicing them properly when a connection becomes available.
>> Watching the activity monitor in SQL2005 we rarely see more than 5-6
>> connections in a runnable state. Although there are many more sleeping.
>> All the code in the web apps and webservices has been exhaustively gone
>> over to ensure connections are being released and in a timely manner.
>> What else could we be missing?
>>
>|||Is that with authentication being unique per user? Or with a common user
throughout the website? I could certainly believe that with a unique user
authentication scenario but if everyone hitting that site is being connected
with the same credentials then I can't see how 15 connections would ever
service all 1 million people. Call me skeptic, (and new to this) but that
is hard to accept. I knew we had a problem but dang, you make me want to
cry :) .....
"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:O8kKlhrbGHA.1264@.TK2MSFTNGP05.phx.gbl...
>A connection will not disappear unless the application terminates the
>connection. So, if the application that issued the batch several days ago
>is still hanging around without anything to do, it is still going to have a
>connection to your server.
> You have a problem with your connection pool settings and management.
> I've worked on websites that are servicing over 1 million CONCURRENT users
> with database requests and they have their pools set to 15.
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
>
> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
> news:%23MprjJrbGHA.2068@.TK2MSFTNGP02.phx.gbl...
>> OK so sleeping processes are only waiting for locks and are actually
>> busy....I misready something there. BUT why do some of these show wait
>> times of zero when the last batch value is sometimes a day ago? If it
>> hasn't run something since yesterday shouldn't the connection be gone by
>> now?
>>
>> "Tim Greenwood" <tim_greenwood A-T yahoo D-O-T com> wrote in message
>> news:%23zJKeBrbGHA.3908@.TK2MSFTNGP02.phx.gbl...
>> We have been fighting with this for some time now. The web group keeps
>> setting the max connections in their connection strings to "2500" yes
>> you read that correct....that seems a little insane. BUT, we've
>> witnesses the site stop working when they lower it. The behavior we are
>> seeing would point at the pool manager not queuing requests and
>> servicing them properly when a connection becomes available.
>> Watching the activity monitor in SQL2005 we rarely see more than 5-6
>> connections in a runnable state. Although there are many more sleeping.
>> All the code in the web apps and webservices has been exhaustively gone
>> over to ensure connections are being released and in a timely manner.
>> What else could we be missing?
>>
>sql

Pooling Connection Object

Hello:

How does one pool a connection object? I have the same application running
on 4 different machines, all connecting to the same server/SQL Server 2000
instance for DB activity.

Some posts have mentioned pooling the connection objects to reduce overhead,
but how do I do that for the 4 separate computers.

Appreciate any response.

Regards,

Ryan Kennedy
Ryan P. Kennedy wrote:

> Hello:
> How does one pool a connection object? I have the same application running
> on 4 different machines, all connecting to the same server/SQL Server 2000
> instance for DB activity.
> Some posts have mentioned pooling the connection objects to reduce overhead,
> but how do I do that for the 4 separate computers.
> Appreciate any response.

You would want to connect your four applications to a single middle tier
process, which remained running, and which maintained one or more open
connections to the DBMS. The middle tier process would act as a proxy for
your client applications, receiving requests, and sending them to the
DBMS via a perpetually-kept connection, and then relaying the returns from
the DBMS to the clients.
A pooled connection can only live as long as the client that made it.
There are two main savings from pooled connections: They save the typically
longer time it takes to make a new connection, and they can be used to
limit the number of simultaneously open DBMS connections, in cases where
licensing or performance dictate that you cannot make a separate connection
for each client.
Joe Weinstein at BEA
> Regards,
>
> Ryan Kennedy

Pooling

Im using SQL Express and ADO.

The connection string im using is

"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=mydatabase;Data Source=TESTBOX\SQLEXPRESS"

The problem i have is there are lots of alerts generated in the security evenlog which are login events almost every second. Our app has many different threads and processes accesing the same database in a Queue fashion. What im concerned by looking at these logs and also looking at the connections opened is that i see all the connections open and close every second and so no connection pooling is happening.

Am i missing something ?

The connection pool is security context specific. When you are using integrated security, each individual user will have their own connection pool.

It is not unusual for a heavily used production server to generate hundreds of login alerts (maybe even thousands) per second. If appropriate for your situation, you may choose to change the alerts to log only Login Failures (and ignore Login successes. )

|||

Thanks for the reply. The services are the ones doing all the calls into SQL. It is always only one user ( The service is running as this user) And i dont see any connection being active for more than a few ms. And i think that means that the connection pool is not even getting created . no ?

but if connection pooling is happening then how can see thousands of logins ? is it not supposed to use the existing connection in the pool and not relogin to SQL ?

Arnie Rowland wrote:

The connection pool is security context specific. When you are using integrated security, each individual user will have their own connection pool.

It is not unusual for a heavily used production server to generate hundreds of login alerts (maybe even thousands) per second. If appropriate for your situation, you may choose to change the alerts to log only Login Failures (and ignore Login successes. )

|||

Having the Login Success/Failure events write to Event Log has little direct relationship with the connection. It has everything to do with security.

One connection pool will still generate an Event Log entry every time there is a query from any user. Every incoming query will have the users' access and/or permissions validated.

If you don't want to have Login Successes filling up your Event Log, then you can change that to Log only Failures. -Or not at all.

|||

ok. but if i set the username password as userid=sa , password then i dont see any events.

btw how do i even see if connection pool is being created or not ?

|||

Take look at this site

http://support.microsoft.com/default.aspx/kb/166083

|||

To determine if connection pooling is happening in the ADO/OLEDB you can enable tracing using the following whitepaper: http://msdn2.microsoft.com/en-us/library/aa964124.aspx.From your connection string you’re using SQLOLEDB which will require that you’re at least on MDAC 2.8 SP2 to get complete tracing.

Hope this helps.

|||Use SQL Profiler and see if you get sp_reset_connection calls. If you do, then you have connection pooling working, otherwise you will see new connections.

You might be destroying the pool if you do not hold onto at least one connection.
There is a performance optimization for COM+ and IIS scenarios, but for a standalone application make sure you do not release everything. For instance in the following ADO code:

For i = 1 To 100

c.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;OLE DB Services=-1; Data Source=.; Initial Catalog=pubs;"

Set r = New ADODB.Recordset

r.Open "SELECT * FROM Authors", c

Set r = Nothing

c.Close

Set c = Nothing

Next I

As soon as you set c to Nothing and don't have other active connections you are going to destroy the whole oledb session pool.

Wednesday, March 21, 2012

Pocket PC is not connection to MSDE database

I want to connect a MSDE database exists in the desktop from Pocket pc 2003 application developed using vb.net. It is giving sql server not found error. It is working in the pocket pc simulater. But it is not working in the pocket pc device. Connection is also working sql server 2000 database. Please help me.Want to show us the connection string?

Might help...|||cs = "data source=mypc\test;initial catalog=test;user id=sa;persist security info=False;workstation id=mypc\test;packet size=4096"|||It's not listed here (and you should post the actual one) but are you supplying a password?|||Originally posted by Brett Kaiser
It's not listed here (and you should post the actual one) but are you supplying a password?

Not supplying the password
I am not supplying the password. I have used the following entries in the setup.ini file while installing the MSDE
[Options]
INSTANCENAME=TEST
SECURITYMODE=SQL
BLANKSAPWD=1

I think i no need a password here. I have also tried with password it is giving same problem. here the code...
Dim cnfordesktop As New System.Data.SqlClient.SqlConnection

'-----------------------
' Open the desktop connection
'-----------------------
Public Function OpenConnectionForDeskTop() As Boolean
Dim cnstr As String = ConnectionStringForDeskTop()
Try
cnfordesktop = New system.Data.SqlClient.SqlConnection(cnstr)
cnfordesktop.Open()
Catch e As SqlClient.SqlException
MessageBox.Show("Error Number: " & e.Number & ", Error Message: " & e.Message & ", Command: " & cnstr, "Database ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Return False
End Try
Return True
End Function
'-----------------------
'close the connection
'-----------------------
Public Sub CloseConnectionForDesktopVM()
Try
cnfordesktop.Close()
Catch ex As Exception

End Try
End Sub
'-----------------------
'Set the connection string property
'-----------------------
Public Function ConnectionStringForDeskTop() As String
Dim cs As String = ""
cs = "data source=mypc\test;initial catalog=test;user id=sa;password=;persist security info=False;"
Return cs
End Function

Pocket PC database connection

Hi,

I am developing an application for a Pocket PC (PPC). I am using Visual studio 2005, and the Operating system on this PPC is Window Mobile 2003 SE. The followings are my codes to connect PPC with the database on my PC with sql server 2005. But when I cick the button1, the error with "SQL Server does not exist or access denied." Any ideas? Thanks a lot.

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Math

Imports System.Drawing

Imports System

Public Class Form1

Dim strConnection As String = "Server=localhost;Integrated Security=SSPI;database=AdventureWorks"

Dim strQuery As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = "Hello, Clicking after."

ReadOrderData()

End Sub

Private Sub ReadOrderData()

Dim queryString As String = "select * from Person.Address where AddressID < '10'"

Using connection As New SqlConnection(strConnection)

Dim command As New SqlCommand(queryString, connection)

connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

While reader.Read()

MsgBox(String.Format("{0}, {1}", _

reader(0), reader(1)))

End While

reader.Close()

End Using

End Sub

End Class

Please see this:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=184007&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=235638&SiteID=1

If it still does not work after you fixed your 'localhost' issue:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=270532&SiteID=1

Also, we have forum dedicated to SQL Mobile. Please post to it should you have any SQL or SQL Mobile related questions:

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=152&SiteID=1

|||

Thanks for your reply.

I would like to install vxUtil, and I have already read the readme.txt file. But I still have some questions about that. Should vxUtil be installed on my personal PC or the Pocket PC(PPC)? If it should be installed in the PPC, how can I install? In the readme.txt, I get the following information:


Open the appropriate folder on the hard drive then double-click
on the InstallCE icon to start the install process for the correct device.

From this information, I feel that vxUtil should be installed in my personal PC. Is it correct?

Could you please answer me about that?

Thanks a lot.

|||

vxUtil should be ultimately installed on device. However, like pretty much all Pocket PC products, it goes through desktop and Active Sync. You install/unzip application on to desktop, then you (or desktop installer) execute something which would push it to device via AS. As a developer you would have to do the same for your application eventually. In some cases there's no desktop installer, just a device CAB file. In that case simply copy CAB to device and click on it from device's file explorer.

|||

Dear Ilya Tumanov,

Your answer is so great. I have already installed it into the PPC, and it scanned the ports in my desktop PC. From the result, the ports 25, 80, 135, 139, 443, 445, 990 and1025 are all open. But the program that I posted yesterday and listed above can not still work. What do I need in the next step?

Moreover, I have changed the connection string to

Dim strConnection As String = "Server=Server1;Integrated Security=SSPI;database=AdventureWorks"

Thanks a lot.

|||

Hi,

I am developing an application for a Pocket PC (PPC). I am using Visual studio 2005, and the Operating system on this PPC is Window Mobile 2003 SE. The followings are my codes to connect PPC with the database on my PC with sql server 2005. But when I cick the button1, the error with "SQL Server does not exist or access denied."

I have already installed vxUtil into the PPC, and Ping is OK. I use it to scan the ports in my desktop PC. From the result, the ports 25, 80, 135, 139, 443, 445, 990 and1025 are all open. But the program can not still work.

Any ideas? Thanks a lot.

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Math

Imports System.Drawing

Imports System

Public Class Form1

Dim strConnection As String = "Server=server1;Integrated Security=SSPI;database=AdventureWorks"

Dim strQuery As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = "Hello, Clicking after."

ReadOrderData()

End Sub

Private Sub ReadOrderData()

Dim queryString As String = "select * from Person.Address where AddressID < '10'"

Using connection As New SqlConnection(strConnection)

Dim command As New SqlCommand(queryString, connection)

connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

While reader.Read()

MsgBox(String.Format("{0}, {1}", _

reader(0), reader(1)))

End While

reader.Close()

End Using

End Sub

End Class


|||

Default SQL Server port is 1433 which is not opened so it's not going to work until your SQL Server is properly configured. Also you have to provide credential in connection string, this string is not going to work.

I'm moving this thread to appropriate forum.

|||

Hi,

Thanks for your answer, and right now 1433 port is open. I would like to use windows authentication protocol. Could you please provide a sample for the connection string? Thanks a lot.

|||

Hi,

Thanks for your answer, and right now 1433 port is open. I would like to use windows authentication protocol. Could you please provide a sample for the connection string? Thanks a lot.

|||

This should work:

"Server=YourServerHere,1433;Initial Catalog=YourDataBaseHere;User ID=YourLoginHere;Password=YourPasswordHere;Integrated Security=SSPI;"

Note you have to provide login and password even though windows authentication will be used. That's because there's no login procedure on devices.

|||

Dear Ilya Tumanov,

Thanks a lot for your so many helps, and it works.

|||

so..It must have a password?is it same with windows user's password?what if blank?

if I'm not wrong, if we set the windows password, we should change the SQL password too right?

|||

you should check this link http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=709129&SiteID=1&mode=1

It works for me after a loooooonggg time testing

Pocket PC database connection

Hi,

I am developing an application for a Pocket PC (PPC). I am using Visual studio 2005, and the Operating system on this PPC is Window Mobile 2003 SE. The followings are my codes to connect PPC with the database on my PC with sql server 2005. But when I cick the button1, the error with "SQL Server does not exist or access denied." Any ideas? Thanks a lot.

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Math

Imports System.Drawing

Imports System

Public Class Form1

Dim strConnection As String = "Server=localhost;Integrated Security=SSPI;database=AdventureWorks"

Dim strQuery As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = "Hello, Clicking after."

ReadOrderData()

End Sub

Private Sub ReadOrderData()

Dim queryString As String = "select * from Person.Address where AddressID < '10'"

Using connection As New SqlConnection(strConnection)

Dim command As New SqlCommand(queryString, connection)

connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

While reader.Read()

MsgBox(String.Format("{0}, {1}", _

reader(0), reader(1)))

End While

reader.Close()

End Using

End Sub

End Class

Please see this:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=184007&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=235638&SiteID=1

If it still does not work after you fixed your 'localhost' issue:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=270532&SiteID=1

Also, we have forum dedicated to SQL Mobile. Please post to it should you have any SQL or SQL Mobile related questions:

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=152&SiteID=1

|||

Thanks for your reply.

I would like to install vxUtil, and I have already read the readme.txt file. But I still have some questions about that. Should vxUtil be installed on my personal PC or the Pocket PC(PPC)? If it should be installed in the PPC, how can I install? In the readme.txt, I get the following information:


Open the appropriate folder on the hard drive then double-click
on the InstallCE icon to start the install process for the correct device.

From this information, I feel that vxUtil should be installed in my personal PC. Is it correct?

Could you please answer me about that?

Thanks a lot.

|||

vxUtil should be ultimately installed on device. However, like pretty much all Pocket PC products, it goes through desktop and Active Sync. You install/unzip application on to desktop, then you (or desktop installer) execute something which would push it to device via AS. As a developer you would have to do the same for your application eventually. In some cases there's no desktop installer, just a device CAB file. In that case simply copy CAB to device and click on it from device's file explorer.

|||

Dear Ilya Tumanov,

Your answer is so great. I have already installed it into the PPC, and it scanned the ports in my desktop PC. From the result, the ports 25, 80, 135, 139, 443, 445, 990 and1025 are all open. But the program that I posted yesterday and listed above can not still work. What do I need in the next step?

Moreover, I have changed the connection string to

Dim strConnection As String = "Server=Server1;Integrated Security=SSPI;database=AdventureWorks"

Thanks a lot.

|||

Hi,

I am developing an application for a Pocket PC (PPC). I am using Visual studio 2005, and the Operating system on this PPC is Window Mobile 2003 SE. The followings are my codes to connect PPC with the database on my PC with sql server 2005. But when I cick the button1, the error with "SQL Server does not exist or access denied."

I have already installed vxUtil into the PPC, and Ping is OK. I use it to scan the ports in my desktop PC. From the result, the ports 25, 80, 135, 139, 443, 445, 990 and1025 are all open. But the program can not still work.

Any ideas? Thanks a lot.

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Math

Imports System.Drawing

Imports System

Public Class Form1

Dim strConnection As String = "Server=server1;Integrated Security=SSPI;database=AdventureWorks"

Dim strQuery As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = "Hello, Clicking after."

ReadOrderData()

End Sub

Private Sub ReadOrderData()

Dim queryString As String = "select * from Person.Address where AddressID < '10'"

Using connection As New SqlConnection(strConnection)

Dim command As New SqlCommand(queryString, connection)

connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

While reader.Read()

MsgBox(String.Format("{0}, {1}", _

reader(0), reader(1)))

End While

reader.Close()

End Using

End Sub

End Class


|||

Default SQL Server port is 1433 which is not opened so it's not going to work until your SQL Server is properly configured. Also you have to provide credential in connection string, this string is not going to work.

I'm moving this thread to appropriate forum.

|||

Hi,

Thanks for your answer, and right now 1433 port is open. I would like to use windows authentication protocol. Could you please provide a sample for the connection string? Thanks a lot.

|||

Hi,

Thanks for your answer, and right now 1433 port is open. I would like to use windows authentication protocol. Could you please provide a sample for the connection string? Thanks a lot.

|||

This should work:

"Server=YourServerHere,1433;Initial Catalog=YourDataBaseHere;User ID=YourLoginHere;Password=YourPasswordHere;Integrated Security=SSPI;"

Note you have to provide login and password even though windows authentication will be used. That's because there's no login procedure on devices.

|||

Dear Ilya Tumanov,

Thanks a lot for your so many helps, and it works.

|||

so..It must have a password?is it same with windows user's password?what if blank?

if I'm not wrong, if we set the windows password, we should change the SQL password too right?

|||

you should check this link http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=709129&SiteID=1&mode=1

It works for me after a loooooonggg time testing

Pocket PC database connection

Hi,

I am developing an application for a Pocket PC (PPC). I am using Visual studio 2005, and the Operating system on this PPC is Window Mobile 2003 SE. The followings are my codes to connect PPC with the database on my PC with sql server 2005. But when I cick the button1, the error with "SQL Server does not exist or access denied." Any ideas? Thanks a lot.

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Math

Imports System.Drawing

Imports System

Public Class Form1

Dim strConnection As String = "Server=localhost;Integrated Security=SSPI;database=AdventureWorks"

Dim strQuery As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = "Hello, Clicking after."

ReadOrderData()

End Sub

Private Sub ReadOrderData()

Dim queryString As String = "select * from Person.Address where AddressID < '10'"

Using connection As New SqlConnection(strConnection)

Dim command As New SqlCommand(queryString, connection)

connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

While reader.Read()

MsgBox(String.Format("{0}, {1}", _

reader(0), reader(1)))

End While

reader.Close()

End Using

End Sub

End Class

Please see this:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=184007&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=235638&SiteID=1

If it still does not work after you fixed your 'localhost' issue:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=270532&SiteID=1

Also, we have forum dedicated to SQL Mobile. Please post to it should you have any SQL or SQL Mobile related questions:

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=152&SiteID=1

|||

Thanks for your reply.

I would like to install vxUtil, and I have already read the readme.txt file. But I still have some questions about that. Should vxUtil be installed on my personal PC or the Pocket PC(PPC)? If it should be installed in the PPC, how can I install? In the readme.txt, I get the following information:


Open the appropriate folder on the hard drive then double-click
on the InstallCE icon to start the install process for the correct device.

From this information, I feel that vxUtil should be installed in my personal PC. Is it correct?

Could you please answer me about that?

Thanks a lot.

|||

vxUtil should be ultimately installed on device. However, like pretty much all Pocket PC products, it goes through desktop and Active Sync. You install/unzip application on to desktop, then you (or desktop installer) execute something which would push it to device via AS. As a developer you would have to do the same for your application eventually. In some cases there's no desktop installer, just a device CAB file. In that case simply copy CAB to device and click on it from device's file explorer.

|||

Dear Ilya Tumanov,

Your answer is so great. I have already installed it into the PPC, and it scanned the ports in my desktop PC. From the result, the ports 25, 80, 135, 139, 443, 445, 990 and1025 are all open. But the program that I posted yesterday and listed above can not still work. What do I need in the next step?

Moreover, I have changed the connection string to

Dim strConnection As String = "Server=Server1;Integrated Security=SSPI;database=AdventureWorks"

Thanks a lot.

|||

Hi,

I am developing an application for a Pocket PC (PPC). I am using Visual studio 2005, and the Operating system on this PPC is Window Mobile 2003 SE. The followings are my codes to connect PPC with the database on my PC with sql server 2005. But when I cick the button1, the error with "SQL Server does not exist or access denied."

I have already installed vxUtil into the PPC, and Ping is OK. I use it to scan the ports in my desktop PC. From the result, the ports 25, 80, 135, 139, 443, 445, 990 and1025 are all open. But the program can not still work.

Any ideas? Thanks a lot.

Imports System.IO

Imports System.Data

Imports System.Data.SqlClient

Imports System.Math

Imports System.Drawing

Imports System

Public Class Form1

Dim strConnection As String = "Server=server1;Integrated Security=SSPI;database=AdventureWorks"

Dim strQuery As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = "Hello, Clicking after."

ReadOrderData()

End Sub

Private Sub ReadOrderData()

Dim queryString As String = "select * from Person.Address where AddressID < '10'"

Using connection As New SqlConnection(strConnection)

Dim command As New SqlCommand(queryString, connection)

connection.Open()

Dim reader As SqlDataReader = command.ExecuteReader()

While reader.Read()

MsgBox(String.Format("{0}, {1}", _

reader(0), reader(1)))

End While

reader.Close()

End Using

End Sub

End Class


|||

Default SQL Server port is 1433 which is not opened so it's not going to work until your SQL Server is properly configured. Also you have to provide credential in connection string, this string is not going to work.

I'm moving this thread to appropriate forum.

|||

Hi,

Thanks for your answer, and right now 1433 port is open. I would like to use windows authentication protocol. Could you please provide a sample for the connection string? Thanks a lot.

|||

Hi,

Thanks for your answer, and right now 1433 port is open. I would like to use windows authentication protocol. Could you please provide a sample for the connection string? Thanks a lot.

|||

This should work:

"Server=YourServerHere,1433;Initial Catalog=YourDataBaseHere;User ID=YourLoginHere;Password=YourPasswordHere;Integrated Security=SSPI;"

Note you have to provide login and password even though windows authentication will be used. That's because there's no login procedure on devices.

|||

Dear Ilya Tumanov,

Thanks a lot for your so many helps, and it works.

|||

so..It must have a password?is it same with windows user's password?what if blank?

if I'm not wrong, if we set the windows password, we should change the SQL password too right?

|||

you should check this link http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=709129&SiteID=1&mode=1

It works for me after a loooooonggg time testing

sql

Tuesday, March 20, 2012

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" 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: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***
Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " 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: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Plz help me SQL 2005 ( Attach database File .mdf )

when i try to attach file there is an error occur
" 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: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified) "
Plz help me i try all things
Enable remote connections on the instance of SQL Server that you want
to connect to from a remote computer.
Turn on the SQL Server Browser service.
Configure the firewall to allow network traffic that is related to SQL
Server and to the SQL Server Browser service
but still error occur
Plz help me
*** Sent via Developersdex http://www.codecomments.com ***Are you able to connect to SQL Server Management studio and exeute simple
queries like SP_WHO and all?
If no; then verify the network connectivity from host to server.
Thanks
Hari
"hossam mohamed" <hosshoss2@.yahoo.com> wrote in message
news:umAN$vEBHHA.2140@.TK2MSFTNGP02.phx.gbl...
> when i try to attach file there is an error occur
> " 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: SQL Network Interfaces, error: 26 - Error
> Locating Server/Instance Specified) "
>
> Plz help me i try all things
> . Enable remote connections on the instance of SQL Server that you want
> to connect to from a remote computer.
> . Turn on the SQL Server Browser service.
> . Configure the firewall to allow network traffic that is related to SQL
> Server and to the SQL Server Browser service
>
> but still error occur
> Plz help me
> *** Sent via Developersdex http://www.codecomments.com ***

Monday, March 12, 2012

Pls Help : "Unable To Connect to Sql Server ..." from Crystal 8.0

Hi All,
I am using Crystal Report 8.0 to create report on MSDE 2000 sp3a , but
when I try to make connection Natively :
More Data Source->MiCrosoft SQL Server-> [Dialog opens]
then I type the ServerName, UserID and Password.
System hangs for a while, then I get this error :
"Unable To Connect to Sql server MyServer"
BUT IF I create system DSN (ODBC) then create the report,
it works.
Why can't I create report Natively on MSDE ?
Thank you very much for any help,
Krist
I'm not very familiar with Crystal Reports. However, since you can make an
ODBC connection, you can test if you are able to make OLEDB connections by
creating a UDL file connection. If the UDL file connection fails, then the
issue may be specific to the OLEDB driver for sql server (you want to
attempt to reinstall MDAC if that is the case).
Also, please see the KB articles below (available at
http://support.microsoft.com):
SAMPLE: How to Create a Data Link File with Windows 2000 - ID: 244659
How to troubleshoot connectivity issues in SQL Server 2000 - ID: 827422
Thanks,
Fany Vargas
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their
Microsoft software to better protect against viruses and security
vulnerabilities. The easiest way to do this is to visit the following
websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx

Friday, March 9, 2012

Please verify SQL Server is running and check your SQL

Hi,
The EU is trying to connect to the SQL Server database
through EM at her desk and she gets the following error
message.
"A connection could not be established to [SERVER NAME] -
specified driver could not be loaded due to system error
126 (SQL Server).
Please verify SQL Server is running and check your SQL
Servcer registration properties (by right-clicking on the
SERVER node) and try again."
These were the steps that were taken to ensure that the
above error could be resolved but invain......
1. Uninstalled SQL SERVER Enterprise Manager on Customers
PC and
reinstalled it - This did not help. Still getting the
following error
message.
(See attached file: sql server error.jpg)
2. Based on some of the information I tried searching for
sqlsrv32.dll file
location and were it was referencing in the registry and
found that it was
referencing to a drive mapping called S:\HR750
\crwxxx\sqlsrv32.dll - This
drive was formerly a people soft mapping which the
customer was using so, I
changed the registry settings to point to the dll file
which resided in
C:\WINNT\SYSTEM32 location, but that also did not help.
3. Made sure that all her patches and MDAC were proper and
fully patched.
Updated it but neither did this help.
4. Checked to see see whether Login Timeout could be
changed from default
of 4 to 8, but was unsuccessful int getting into that
options on the EM.
5. It looks more that some dll is corrupt which is causing
this problem on
the customres PC. I tried accessing ODBC Settings and
selected SQL Server
Driver and I get the following error message
"The setup routines for the SQL Server ODBC driver should
not be loaded due
to system error code 126"
and when I click on "OK", I get the next screen which has
a title
Driver's ConfigDSN, ConfigDriver, or Config Translator
failed
"Could not load the setup or translator library"
It sounds like a corrupt MDAC installation. Reinstalling the current
version of MDAC is a tricky proposition. If you have not upgraded to MDAC
2.8 on this machine you could do that and more than likely resolve this
problem.
Rand
This posting is provided "as is" with no warranties and confers no rights.