PC Review


Reply
Thread Tools Rate Thread

Connect to SQL Server 2000

 
 
Chris Voon
Guest
Posts: n/a
 
      28th Nov 2003
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
------------------------------------------------------
 
Reply With Quote
 
 
 
 
marcmc
Guest
Posts: n/a
 
      28th Nov 2003
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()

 
Reply With Quote
 
Frank
Guest
Posts: n/a
 
      1st Dec 2003
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.


>-----Original Message-----
>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
>------------------------------------------------------
>.
>

 
Reply With Quote
 
Kevin Boske - [MS]
Guest
Posts: n/a
 
      4th Dec 2003
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
((E-Mail Removed))
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" <(E-Mail Removed)>
Sender: "Chris Voon" <(E-Mail Removed)>
Subject: Connect to SQL Server 2000
Date: Fri, 28 Nov 2003 04:14:11 -0800
Lines: 31
Message-ID: <08e601c3b5a9$2170ffe0$(E-Mail Removed)>
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
------------------------------------------------------


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
not able to connect to sql server 2000 yoshitha Microsoft Dot NET 1 5th Jan 2006 02:44 PM
VPN Wndows 2000 Server won't connect to Windows 2003 Server Manuel A. Toranzo Windows XP Work Remotely 1 29th Sep 2005 05:45 PM
How do i change this connect string to support a SQL Server 2000 running on port 8832 User ID=car;Password=rat;Server=abc.def.hij;Initial Catalog=foobar i tried Server=abc.def.hij:8823 and Server=abc.def.hij;port=8823 neither of these work Daniel Microsoft Dot NET Framework 1 16th Dec 2004 09:55 PM
XP Pro connect to 2000 Server & NT Server domains =?Utf-8?B?U3R1IEE=?= Windows XP Networking 4 25th Nov 2004 07:59 PM
2000 client vpn cannot connect to 2000 server Andrew Microsoft Windows 2000 RAS Routing 0 4th Jul 2003 06:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:06 AM.