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

G

Gary

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();
}

}
 
C

carnivore

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
 
S

Simon Hart [MVP]

What is the exception message? ensure the SQL Server has tcp/ip connectivity
enabled.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top