all groups > dotnet compact framework > december 2007 >
You're in the

dotnet compact framework

group:

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


C# coding connection to sql 2005 express on pocket pc 2003 Gary
12/19/2007 9:29:02 AM
dotnet compact framework:
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
Re: C# coding connection to sql 2005 express on pocket pc 2003 carnivore
12/20/2007 9:15:32 AM
Gary pisze:
[quoted text, click to view]

Instead of instance of database try use a port.

Instead of
192.168.11.3\sqlexpress
try
RE: C# coding connection to sql 2005 express on pocket pc 2003 Simon Hart [MVP]
12/22/2007 8:56:00 AM
What is the exception message? ensure the SQL Server has tcp/ip connectivity
enabled.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


[quoted text, click to view]
AddThis Social Bookmark Button