SQL Server 2000 Connection Problem from VS2005 Windows Mobile appl


T

TaurusE3

Hi,
I have made a small application in both VS2003 and VS2005, from
VS2003's emulator when i run application made in VS2003 can easily connect to
the SQL Server 2000 database but when i put the same code in VS2005, run
application through VS2005's emulator and when i try to connect to the SQL
Server 2000 database it gives me error,

"SQL Server does not exist or
access denied."

the only differece in both emulator is the PDA OS Version.

VS2005 Emulator is Pocket PC 2003 Second Edition : Windows Mobile 2003
Second Edition Version 4.21.1088 (Build 14342.2.5.0)

and other is

VS2003 Emulator is Pocket PC 2002 : Microsoft Pocket PC Version 3.0.11171
(Build 11178)

I have wrote same code for both environment which is,

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objDeskCon As SqlConnection = GetDesktopDBConnection()
End Sub

Public Function GetDesktopDBConnection() As SqlConnection
Try
If (IsNothing(m_DesktopConn)) Then

m_DesktopConn = New SqlConnection("Password=sa;User
ID=sa;Initial Catalog=PDA2005;Data Source=172.20.107.90")
m_DesktopConn.Open()
ElseIf Not (IsNothing(m_DesktopConn)) Then
If m_DesktopConn.State = ConnectionState.Closed Then

m_DesktopConn = New SqlConnection("Password=sa;User
ID=sa;Initial Catalog=PDA2005;Data Source=172.20.107.90")
m_DesktopConn.Open()
End If
End If
Return m_DesktopConn
Catch ex As SqlException
MessageBox.Show(ex.Message)
End Try
End Function

Can any one tell what the wrong i am doing, or what the limitations are.
or can't i connect to the sql server 2000 database from a Windows Mobile
device?

Thanx in advance.
 
Ad

Advertisements

D

dbgrick

Try connecting to your emulator by activeSync. Use 2005 to connect to your
emulator, then open the Device Emulator Manager. Located under the tools menu
in VS 2005. Find your device, it should have the connected image next to it
and right click on your emulator. Select the Cradle menu option. This
should start ActiveSync and connect to the device, just like a real device.
Then try you application. You're probably not able to connect to you DB,
because the device can not see your network.

Regards,
Rick D.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top