Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / December 2007

Tip: Looking for answers? Try searching our database.

C# coding connection to sql 2005 express on pocket pc 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary - 19 Dec 2007 17:29 GMT
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
carnivore - 20 Dec 2007 08:15 GMT
Gary pisze:
> I am working a project which using pocket pc 2003 connect to sql 2005
> express database.
>             string connstr = @"data source=192.168.11.3\SQLEXPRESS;Initial
> Catalog=FYP;User ID=sa;Password = 61818030";

Instead of instance of database try use a port.

Instead of
192.168.11.3\sqlexpress
try
192.168.11.3,port
Simon Hart [MVP] - 22 Dec 2007 16:56 GMT
What is the exception message? ensure the SQL Server has tcp/ip connectivity
enabled.
Signature

Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com

> Dear All
>
[quoted text clipped - 40 lines]
> Best Regards
> Gary

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.