Connect to Desktop SQL Server 2000 from Pocket PC

L

Leonardo Castillo

Hi,

I need to connect from a program in the Pocket PC to SQL Server in my
desktop. How i can do than in VB.NET ?.
(I need an information in one table in SQL Server 2000).

Thanks,

Leonardo Castillo.
 
A

Alex Feinman [MVP]

You need to use SqlClient class available in System.Data.SqlClient. It works
pretty much the same way as on the desktop except IIRC the Integrated
Security=SSPI is not supported. You need to use User ID= and Password=
 
W

William Ryan eMVP

Just add a reference to the System.Data.SqlClient .dll file. Then just add
the using/imports statement and use everything essentially like you would on
the full framework. I'd recommend putting a little extra into my exception
handling routines b/c if you are going wireless you can have a good many
things go wrong - but everything I'm speaking about can go wrong even on the
desktop. Anyway, your connection string and everything else is just like
you would on the desktop.

HTH

Bill


Leonardo Castillo said:
Hi,

I need to connect from a program in the Pocket PC to SQL Server in my
desktop. How i can do than in VB.NET ?.
(I need an information in one table in SQL Server 2000).

Thanks,

Leonardo Castillo.

--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
 
L

Leonardo Castillo

Thanks a lot for your answer. I try this, however i get a following error message
"General network error".

This is the code:

Dim xx As New SqlClient.SqlConnection("Data Source=LEOC2004;DataBase=cas;User ID=sa;Password=sa")

Try

xx.Open()

Catch exSQL As SqlClient.SqlException

MsgBox(exSQL.Message)

End Try

(The SQL Server Name (instance) is LEOC2004).

Thanks



Leonardo Castillo
 
I

Ilya Tumanov [MS]

SSPI is in fact supported, but you have to provide user ID and password
anyway as CE does not have this information.
This might be useful if SQL authentication is disabled on a server.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
I

Ilya Tumanov [MS]

Don't forget a reference to System.Data.Common.dll or it won't work.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
A

Alex Feinman [MVP]

Thank you.

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Ilya Tumanov [MS]" said:
SSPI is in fact supported, but you have to provide user ID and password
anyway as CE does not have this information.
This might be useful if SQL authentication is disabled on a server.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Alex Feinman [MVP]" <[email protected]>
References: <eV#[email protected]>
Subject: Re: Connect to Desktop SQL Server 2000 from Pocket PC
Date: Mon, 21 Jun 2004 10:19:20 -0700
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 204.249.181.133
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED
01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:55645
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

You need to use SqlClient class available in System.Data.SqlClient. It works
pretty much the same way as on the desktop except IIRC the Integrated
Security=SSPI is not supported. You need to use User ID= and Password=
 
M

Mystic Mong

Hi there,

I have been attempting to perform a similar task today - I need to send data
from a local SqlCe table to a database residing on a desktop machine. I have
MSDE installed on the desktop and it accepts network requests (tested from
another laptop).

My problem is that when my PDA is connected to the desktop via ActiveSync I
get "Could not find server" exceptions when I try to execute the
SqlConnection Open command.

My connection string is essentially the same as Leonardo's (server name,
instance name, username and password). My connection string is the same as I
use for connecting to our enterprise SQL Server via wireless connection so
is there a reason why I am having problems via ActiveSync? I am assuming I
have missed something basic as my knowledge is limited on this stuff.

Any help (code snippet would be fab!) would be much appreciated.

Cheers

C-Ya Aly
 
R

Robert J

I am using :

Imports System.Data.SqlClient

Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdLogin.Click

Dim Conn As New SqlConnection
Dim strConnString As String

Try
strConnString = "server=" & strServer & "; uid=sa; password=;
database=" & strDBase
Conn.ConnectionString = strConnString
Conn.Open()
Catch ex as exception
Arggghhhhhhhhhhhhh !!!!
End Try
End Sub

For SQL Server 7 but MSDE should be the same

Cheers

Robert
 
G

Guest

I tried the proposed solution in both windows CE emulator and Pocket PC.
Pocket PC works fine, but Windows CE can't open the connection ('Platform not
supported' Error). Anyone had this problem?

Thnx,
Dejan
 

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