【求助】vs2005+sql2000 同步获取数据失败
在模拟器中访问 http://192.168.1.150/sqlce/sscesa20.dll 一切正常,IIS没有设置密码,
创建数据成功了。pull时提示错误!
public FormMain()
{
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
strDBFile = string.Format(@ "{0}\Northwind.sdf ",
Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase));
strConnLocal = string.Format(@ "Data Source = {0} ", strDBFile);
}
private string strConnRemote = "Provider=sqloledb; "
+ "Data Source=192.168.1.150; "
+ "Initial Catalog=Northwind; "
+ "User Id=sa; "
+ "Password=sa; "
+ "Integrated Security=SSPI; ";
// The URL
private string strURL =
"http://192.168.1.150/sqlce/sscesa20.dll ";
private void cmdPull_Click(object sender, EventArgs e)
{
SqlCeRemoteDataAccess rdaNW =
new SqlCeRemoteDataAccess(strURL, strConnLocal);
try
{
rdaNW.LocalConnectionString = strConnLocal;
rdaNW.InternetUrl = strURL;
rdaNW.InternetLogin = " ";
rdaNW.InternetPassword = " ";
rdaNW.Pull( "Categories ",
"SELECT CategoryID, CategoryName " +
" FROM Categories ",
strConnRemote,
RdaTrackOption.TrackingOnWithIndexes,
"ErrorCategories ");
MessageBox.Show( "数据下载成功OK! ");
}
catch( SqlCeException exSQL )
{
HandleSQLException(exSQL);
}
finally
{
rdaNW.Dispose();
}
}
提示错误:An internal error occurred,[ID,,,,]
Microsoft SQL Server 2000 Windows CE Edition
用户‘MDMDDD\IUSR_MDMDDD33’登录失败。:Microsoft OLE DB
Provider for SQL Server
[解决办法]
登陆SQL Server 报错了
[解决办法]
你的连接有问题:
"Provider=sqloledb; "
+ "Data Source=192.168.1.150; "
+ "Initial Catalog=Northwind; "
+ "User Id=sa; "
+ "Password=sa; "
+ "Integrated Security=SSPI; ";