Pocket PC access to SQL Server 2000 
Author Message
 Pocket PC access to SQL Server 2000

I am trying to connect to a SQL Server 2000 database using a Pocket PC
running Windows CE. According to Microsoft it is possible to do this
using sqlclient. I have tried the following C# code, which works as
expected when run within a windows application environment. When the
same code is run in a smart device environment on a pocket pc emulator
the code fails when the connection string is opened.

string mySelectQuery = "SELECT SiteID FROM tblSites";

SqlConnection myConnection = new SqlConnection("server=server; Initial

Catalog=database;UID=user;PWD=password; Integrated Security=SSPI");

SqlCommand myCommand = new SqlCommand(mySelectQuery,myConnection);

myConnection.Open(); //code fails here

SqlDataReader myReader = myCommand.ExecuteReader();

while (myReader.Read())
{
MessageBox.Show(myReader.GetInt32(0).ToString());

Quote:
}

myReader.Close();

myConnection.Close();

The code fails on myConnection.Open() and throws the following

 'System.Data.SqlClient.SqlException'

Does anyone have any ideas?

Aidan



Sat, 28 May 2005 16:32:23 GMT  
 Pocket PC access to SQL Server 2000
Hi Aidan,

I have successfully used a third-party-component called ViaDB from Odyssey
Software to connect to a SQL-server 2000 via my Compaq iPaq 3870 (and a
SonyEricsson T68i using bluetooth). Check out this link :

http://www.odysseysoftware.com/viadb_main.html

Maybe it can be of use to you too...the single-user license is free if I
remember correctly.

/Per Hultqvist


Quote:
> I am trying to connect to a SQL Server 2000 database using a Pocket PC
> running Windows CE. According to Microsoft it is possible to do this
> using sqlclient. I have tried the following C# code, which works as
> expected when run within a windows application environment. When the
> same code is run in a smart device environment on a pocket pc emulator
> the code fails when the connection string is opened.

> string mySelectQuery = "SELECT SiteID FROM tblSites";

> SqlConnection myConnection = new SqlConnection("server=server; Initial

> Catalog=database;UID=user;PWD=password; Integrated Security=SSPI");

> SqlCommand myCommand = new SqlCommand(mySelectQuery,myConnection);

> myConnection.Open(); //code fails here

> SqlDataReader myReader = myCommand.ExecuteReader();

> while (myReader.Read())
> {
> MessageBox.Show(myReader.GetInt32(0).ToString());
> }

> myReader.Close();

> myConnection.Close();

> The code fails on myConnection.Open() and throws the following

>  'System.Data.SqlClient.SqlException'

> Does anyone have any ideas?

> Aidan



Sat, 28 May 2005 22:38:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access SQL Server 2000 Data Analysis Services

2. Porting SQL Server 7 Stored Procedures to Access 2000

3. pocket access vs sql server

4. htmlctrl Pocket PC 2002/2000

5. Pocket PC / Pocket PC 2002: CDialog::m_bFullScreen

6. New article at Pocket PC Developer Network - Testing programs on Pocket PC

7. Pocket PC / Pocket PC 2002: CDialog::m_bFullScreen

8. what differencies are between Pocket PC SDK an Pocket PC 2002 SDK

9. Can't delete rows from a table in SQL Server 2000 without a primary key

10. SQL Server 2000 Trial Version ?

11. SQl Server 2000

12. SQL 2000 Server Stuff - 33 CDs

 

 
Powered by phpBB® Forum Software