Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Connecting to SQL Server from Pocket PC

0 views
Skip to first unread message

michael

unread,
Apr 22, 2003, 10:12:29 PM4/22/03
to
I'm having difficulty making a simple connection, using a
SQLConnection object, from a PocketPC app, to a SQL
Server on my desktop. I believe that the problem is in my
connection string.

What do I need in my PPC app so that I can connect to SQL
Server on a network?

Do I use Windows Authentication or SQLServer
Authentication. If Windows Authentication, what ID/PW
does the PPC use?

Can I use the same connection string that works in
a 'Full' Framework SQLConnection object in a Compact
Framework SQLConnection object?

Got a generic connection string?

Michael

Jonne Kats

unread,
Apr 23, 2003, 3:07:52 AM4/23/03
to
You can use the normal connectionstring that you use on the desktop aswell.
You need to use the normal sqlclient instead of the sqlceclient.

HTH

--
Jonne Kats
Advisor ICT Solutions
www.advisor.nl
"michael" <mic...@hockstein.org> wrote in message
news:085a01c3093d$ca9715a0$3301...@phx.gbl...

Alex Feinman

unread,
Apr 23, 2003, 3:14:11 AM4/23/03
to
Try SQL authentication as it is easier to manage.
 
The following code worked for me after some tweaking:
 

SqlConnection conn =

new SqlConnection(@"Data Source=192.168.5.16\netSDK;Initial Catalog=Master;user ID=bob;");
conn.Open();
SqlDataAdapter da =
new SqlDataAdapter("Select * from sysdatabases", conn);
DataTable tbl =
new DataTable("SysDatabases");
da.Fill(tbl);
listBox1.DisplayMember =
"name";
listBox1.ValueMember =
"name";
listBox1.DataSource = tbl;
Things to remember:
1) In the code above IP address should be replaced with IP address of your server.
2) If you are using Emulator, make sure that IE can connect to internet - yahoo or such. If it can't you might need to choose option "My network Card connects to Internet" in network settings
3) If you are connecting to MSDE - you will need to enable SQL authentication and add a user:
To enable SQL authentication follow http://support.microsoft.com/default.aspx?scid=kb;EN-US;285097 - the part about editing registry
To add a login use OSQL in "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\"
osql -E -S (local)\NetSDK
1> sp_addLogin bob
2> sp_adduser bob
3> go <enter>
 
4) Enable network connections to MSDE. Run "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\svrnetcn.exe"
Add TCP/IP and Named Pipe  protocols. ClickOK
 
HTH
 

--
Alex Feinman
MVP Windows Media Center
 
 
 

michael

unread,
Apr 23, 2003, 8:23:48 AM4/23/03
to
If I use Windows Authentication, where does the ID/PW
come from? I don't recall "logging" on to the PPC.

Michael

Jonne Kats

unread,
Apr 23, 2003, 10:43:44 AM4/23/03
to
Its not very nice, but you can put password= in the connectionstring

--
Jonne Kats
Advisor ICT Solutions
www.advisor.nl

"michael" <mic...@hockstein.org> wrote in message

news:05a201c30993$315a7480$a601...@phx.gbl...

Dan Fergus

unread,
Apr 24, 2003, 9:18:36 AM4/24/03
to
If your IIS virtual directory is set for Windows authorization you will be
prompted for an ID/password when you try to connect.

Dan

"michael" <mic...@hockstein.org> wrote in message

news:05a201c30993$315a7480$a601...@phx.gbl...

Doug Thews

unread,
Apr 24, 2003, 6:59:55 PM4/24/03
to
Unless you specify the IISLogin & IISPassword as part of the
Merge/Replication or RDA objects (which is what I'm assuming since IIS isn't
required for direct connect SQL connections).

--
Doug Thews
Director, Software Development
D&D Consulting Services


"Dan Fergus" <d...@vbforest.com> wrote in message
news:OQ9zuRmC...@TK2MSFTNGP10.phx.gbl...

Dan Fergus

unread,
Apr 25, 2003, 1:17:20 PM4/25/03
to
True,

I was thinking he was using the SQL Client to talk to SQL Server directly.

-I'm having difficulty making a simple connection, using a
-SQLConnection object, from a PocketPC app, to a SQL
-Server on my desktop.

Dan

"Doug Thews" <doug...@removeme.ddconsult.com> wrote in message
news:#H#c6UrCD...@TK2MSFTNGP11.phx.gbl...

Doug Thews

unread,
Apr 25, 2003, 6:58:52 PM4/25/03
to
If you're using the emulator, you'll need to enable the Guest account on
your PC (which the emulator uses), and then create the same account on SQL
Server and give it access. If not, then you'll need to setup either Windows
or SQL (depending on the option you select) for the user that the Pocket PC
device is logging in under.

--
Doug Thews
Director, Software Development
D&D Consulting Services

"Dan Fergus" <d...@vbforest.com> wrote in message

news:ePi1$C1CDH...@TK2MSFTNGP11.phx.gbl...

Kevin Boske - [MS]

unread,
Apr 28, 2003, 6:26:26 PM4/28/03
to
Since the device does not support a Windows login, you must pass the User
ID and Password properties along with Integrated Security=SSPI; to your
ConnectionString.


Kevin Boske
(kbo...@microsoft.com)
SQL Server CE Team
Microsoft
----------------------------------------------------------------------------
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
----------------------------------------------------------------------------
----------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
----------------------------------------------------------------------------
----------------------------------------
--------------------
Content-Class: urn:content-classes:message
From: "michael" <mic...@hockstein.org>
Sender: "michael" <mic...@hockstein.org>
References: <085a01c3093d$ca9715a0$3301...@phx.gbl>
<ulU7xfWC...@TK2MSFTNGP12.phx.gbl>
Subject: Re: Connecting to SQL Server from Pocket PC
Date: Wed, 23 Apr 2003 05:23:48 -0700
Lines: 79
Message-ID: <05a201c30993$315a7480$a601...@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcMJkzFaN9H63pmPRqCxs6iDpI3e0A==
Newsgroups: microsoft.public.dotnet.framework.compactframework
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:21384
NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Alex Feinman

unread,
May 1, 2003, 1:57:30 PM5/1/03
to
I thought Integrated Security=SSPI; indicates using Windows
authentication...

""Kevin Boske - [MS]"" <kbo...@online.microsoft.com> wrote in message
news:0N1w5UdD...@cpmsftngxa06.phx.gbl...

Kevin Boske - [MS]

unread,
May 2, 2003, 1:18:06 PM5/2/03
to
Integrated Security=SSPI does indicate Windows Authentication in this case.
Because the device has no Windows Integrated Login, the
SqlClient.Connection object needs the login and password passed to it so
that it can participate in the normal Windows Authentication scheme.

Kevin Boske
(kbo...@microsoft.com)
SQL Server CE Team
Microsoft
----------------------------------------------------------------------------
----------------------------------------
Everything you need to know about SQL Server CE:

http://www.microsoft.com/sql/ce/techinfo/default.asp
----------------------------------------------------------------------------
----------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
----------------------------------------------------------------------------
----------------------------------------
--------------------

From: "Alex Feinman" <publi...@alexfeinman.com>
References: <085a01c3093d$ca9715a0$3301...@phx.gbl>
<ulU7xfWC...@TK2MSFTNGP12.phx.gbl>
<05a201c30993$315a7480$a601...@phx.gbl>
<0N1w5UdD...@cpmsftngxa06.phx.gbl>


Subject: Re: Connecting to SQL Server from Pocket PC

Date: Thu, 1 May 2003 10:57:30 -0700
Lines: 137
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <uotyjsAE...@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: 204.249.181.133
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:22099
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Alex Feinman

unread,
May 5, 2003, 12:04:49 PM5/5/03
to
Yes, I can see that now. Thanks.

""Kevin Boske - [MS]"" <kbo...@online.microsoft.com> wrote in message

news:KxQpP7ME...@cpmsftngxa06.phx.gbl...


> Integrated Security=SSPI does indicate Windows Authentication in this
case.
> Because the device has no Windows Integrated Login, the
> SqlClient.Connection object needs the login and password passed to it so
> that it can participate in the normal Windows Authentication scheme.
>
>
>
> Kevin Boske
> (kbo...@microsoft.com)
> SQL Server CE Team
> Microsoft

0 new messages