Connect to SQL Server 2000


C

Chris Voon

I use the following code to connect to SQL server 2000
from a connected PPC device. My pocket explorer is able
to view the ssce. I execute the code on real pocketpc
2002 device and emulator and both throws an exception
when i execute the Open() method. An
PlatformNotSupportedException thrown. Any idea what's
wrong? I'm using SQL server 2000 with sp3 and sp3a sql ce
server tools
----------------------------------------
Public Sub GetResultSets()
Dim conNwindCE As SqlConnection
Dim cmdData As SqlCommand
Dim connString As String
Dim dr As SqlDataReader

Try
' Create and open a connection
connString
= "server=10.1.12.72;database=NWind_SQLCE;"
connString &= "user id=sa;pwd=pwd;"
conNwindCE = New SqlConnection(connString)
conNwindCE.Open()
......
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
dr.Close()
conNwindCE.Close()
End Try
End Sub
------------------------------------------------------
 
Ad

Advertisements

M

marcmc

double check you are using PPC2002
Dim HostName As String = System.Net.Dns.GetHostName()

You have the right versions, can't see anything wrong
with your code...maybe try....this as this definetly
works..
set txtDBName.Text on screen for something like
\Storage Card\FolderName\DBName.sdf
-- wherever your sqlce db lives

Private DBNameConnection As SqlCeConnection

DBconnection = New SqlCeConnection("Data Source = " &
txtMasterDB.Text)

DBNameConnection.Open()
// code
DBNameConnection.Close()
DBNameConnection.Dispose()
 
F

Frank

If I understand properly you try to open a table on the
server from the ppc. this is not possible: or you connect
to a database residing on the ppc, which you synchronize
with the server or you download a table from the server to
the ppc.
 
Ad

Advertisements

K

Kevin Boske - [MS]

Chris,

Is your Pocket PC using the same language as your SQL Server? If they do
not match, change the Collation of the SQL Server Database to match that of
the SQL Server.


Kevin Boske
([email protected])
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: "Chris Voon" <[email protected]>
Sender: "Chris Voon" <[email protected]>
Subject: Connect to SQL Server 2000
Date: Fri, 28 Nov 2003 04:14:11 -0800
Lines: 31
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcO1qSFwANmh94gcTFiFlRhumjrpYg==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.framework.compactframework
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:39782
NNTP-Posting-Host: tk2msftngxa09.phx.gbl 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

I use the following code to connect to SQL server 2000
from a connected PPC device. My pocket explorer is able
to view the ssce. I execute the code on real pocketpc
2002 device and emulator and both throws an exception
when i execute the Open() method. An
PlatformNotSupportedException thrown. Any idea what's
wrong? I'm using SQL server 2000 with sp3 and sp3a sql ce
server tools
----------------------------------------
Public Sub GetResultSets()
Dim conNwindCE As SqlConnection
Dim cmdData As SqlCommand
Dim connString As String
Dim dr As SqlDataReader

Try
' Create and open a connection
connString
= "server=10.1.12.72;database=NWind_SQLCE;"
connString &= "user id=sa;pwd=pwd;"
conNwindCE = New SqlConnection(connString)
conNwindCE.Open()
......
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
dr.Close()
conNwindCE.Close()
End Try
End Sub
------------------------------------------------------
 

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