請幫忙。 我有設備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