请帮忙。 我有设备MC3200 Zebra(摩托罗拉)(Windows Embedded版本7,版本2864)。该设备正在连接到网络并查看SQL服务器(ping可以)。我用它的Visual Studio 2008,C#,SmartDevicePrj,.NET CF 3.5如何将windows CE c#应用程序连接到数据库SQL Server2008r2
但之后在设备上启动应用程序将显示消息:
在连接字符串中未知的连接选项:初始目录。
一些想法如何修复它?
非常感谢您的帮助。
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlServerCe;
namespace SmartDeviceProject1
{
public partial class Form1 : Form
{
public SqlCeConnection msConn;
public string strCon = "";
public SqlCeCommand command;
public Form1()
{
InitializeComponent();
strCon = "Data Source=server007; Initial Catalog=FMPredlis; User ID=mistr; Password=heslo;";
try
{
msConn = new SqlCeConnection(strCon);
msConn.Open();
MessageBox.Show("Připojeno");
}
catch (SqlCeException ex)
{
MessageBox.Show("Chyba" + ex.Message);
msConn.Close();
}
}
}
}
确定Windows CE设备可以查找名为“server007”的名字? – BugFinder
IIRC,SqlCeConnections被指定为“Data Source = MyData.sdf”,根本无法连接到“真实”SQL服务器。 – dlatikay