wince 到底能不能直连pc的sqlserver?
我的连接字符串:Data Source=192.168.1.1;Initial Catalog=DB;User ID=sa;Password=sa
模拟器上提示“连接字符串database中未知的连接选项”
模拟器可以上网,用activesync连的
网络上有人说可以,有人说不行,没有搜到权威的实例
我的开发环境wince6.0 c# sqlserver2000
代码:
string CONN_STRING_REMOTE = "Data Source=10.196.8.103;Initial Catalog=Check_DB;User ID=sa;Password=chh@oa.com";
string SELECT_Products = "select * from t_staff_info";
SqlCeConnection conn = new SqlCeConnection();
conn.ConnectionString = CONN_STRING_REMOTE;
SqlCeCommand comm = new SqlCeCommand();
comm.CommandType = CommandType.Text;
comm.CommandText = SELECT_Products;
comm.Connection = conn;
SqlCeDataAdapter da = new SqlCeDataAdapter();
da.SelectCommand = comm;
DataTable dt = new DataTable();
try
{
da.Fill(dt);
}
catch (SqlCeException ex)
{
MessageBox.Show(ex.Message);
}
dataGrid1.DataSource = dt;