mspocketpc.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C# connect to sql 2005 sqlexpress on pockpet PC 2003

 
Post new topic   Reply to topic    mspocketpc.org Forum Index -> Developer Networking
Author Message
Gary



Joined: 15 Aug 2007
Posts: 3

PostPosted: Wed Dec 19, 2007 2:31 pm    Post subject: C# connect to sql 2005 sqlexpress on pockpet PC 2003 Reply with quote

Dear All

I am working a project which using pocket pc 2003 connect to sql 2005
express database.

When I try to deploy a testing program on C# 2005, i cannot create the
connection with a Sql Exception error.

Do anyone have such experience and provide me a solution.

my devlice is O2 XdaIIi and the .net CF is 2.0

my coding as below:

---------------------------------------------------


string connstr = @"data source=192.168.11.3\SQLEXPRESS;Initial
Catalog=FYP;User ID=sa;Password = 61818030";

try
{
conn = new SqlConnection(connstr);
conn.Open();

if (conn.State == ConnectionState.Open)
{
MessageBox.Show("A");
}
{
MessageBox.Show("B");
}


}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
conn.Close();
}

}
------------------------------------------------

Best Regards
Gary

Archived from group: microsoft>public>pocketpc>developer>networking
Back to top
View user's profile Send private message
Simon Hart [MVP]



Joined: 04 Oct 2007
Posts: 37

PostPosted: Thu Jan 03, 2008 1:51 pm    Post subject: RE: C# connect to sql 2005 sqlexpress on pockpet PC 2003 Reply with quote

What exception are you getting?, ensure the database accepts tcp/ip
connections.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


"Gary" wrote:

> Dear All
>
> I am working a project which using pocket pc 2003 connect to sql 2005
> express database.
>
> When I try to deploy a testing program on C# 2005, i cannot create the
> connection with a Sql Exception error.
>
> Do anyone have such experience and provide me a solution.
>
> my devlice is O2 XdaIIi and the .net CF is 2.0
>
> my coding as below:
>
> ---------------------------------------------------
>
>
> string connstr = @"data source=192.168.11.3\SQLEXPRESS;Initial
> Catalog=FYP;User ID=sa;Password = 61818030";
>
> try
> {
> conn = new SqlConnection(connstr);
> conn.Open();
>
> if (conn.State == ConnectionState.Open)
> {
> MessageBox.Show("A");
> }
> {
> MessageBox.Show("B");
> }
>
>
> }
> catch (Exception ex)
> {
> MessageBox.Show(ex.Message);
> conn.Close();
> }
>
> }
> ------------------------------------------------
>
> Best Regards
> Gary
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
PocketPC 2003 - Connect to Work versus Connect to Internet - I've been trying to set up a file share or web share on my local network so that I can play MP3 files on my wireless Pocket PC 2003. I found that in order to connect to a file share I had to configure: "My network card connects to WORK" (as opposed to TH

Problem with Visual Studio 2003 and Pocket PC 2003 I am unable to connect to my Dell Axim device running Pocket PC 2003 from Visual Studio 2003. The emulator works fine. I am triying to connect using TCP/IP over an Activsync connection. This worked fine when I was using Pocket PC 2002; now I get the messa

Wifi connection not recognised by PocketPC 2005. We have an application that we developed initially for Pocket PC 2002 (Win Mobile 4.2). This application establishes an 802.11 association when the device is in range of "special" access points. "Special" basically means an AP is in a database of known AP

connect to a proxy I want to make a TCP/IP connection between pocketpc and a proxy server on my desktop. Since I don't want to have ActiveSync.Is it possible? thanks, Chico

How to connect the wm6 standard with vpn Hi, I have setup the vpn connection in my wm6 standard device (smart phone). The question is how to make it connect (I can't find any where that i can turn the connection on)? Thanks for helping
Post new topic   Reply to topic    mspocketpc.org Forum Index -> Developer Networking All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group