rda访问远程数据库问题,在线等待!
亮灯了 2006-07-10 09:40:21 用VS.NET 2005, SQL Server 2000,SQL Server 2000 sp4,SQL Server Mobile(SQL Server ce3.0).C#
RDA同步数据时出现这样的异常:
A request to send data to the computer running IIS has failed!
我的程序是这样的:
string strDBFile = @"My Documments\Northwind.sdf";
string strConnLocal = "Data Source=" + @"My Documents\Northwind.sdf";
//Data Source=GL-2005;Initial Catalog=canyin_self;User ID=sa;Integrated Security=SSPI;
string strConnRemote = "Provider=SQLOLEDB;User ID = sa;pwd ='';Initial Catalog=Northwind;Data Source=GL-2005";
string strURL = "http://192.168.0.202/MobileServer/sqlcesa30.dll";
SqlCeConnection lsqlcecon_Conn = null;
if(File.Exists(strDBFile))
{
File.Delete(strDBFile);
}
SqlCeEngine dbEngine = new SqlCeEngine();
dbEngine.LocalConnectionString = strConnLocal;
try
{
dbEngine.CreateDatabase();
}
catch(SqlCeException exSQL)
{
MessageBox.Show("Unable to create database" + exSQL.Errors[0].Message);
}
SqlCeRemoteDataAccess rdaNW = new SqlCeRemoteDataAccess();
try
{
rdaNW.LocalConnectionString = strConnLocal;
rdaNW.InternetUrl = strURL;
rdaNW.InternetLogin = "";
rdaNW.InternetProxyPassword = "";
rdaNW.Pull("Categories", "SELECT CategoryID,CategoryName,Description FROM Categories", strConnRemote, RdaTrackOption.TrackingOnWithIndexes, "ErrorDoctor");
}
catch(SqlCeException exSQL)
{
//ShowErrors(exSQL);
MessageBox.Show(exSQL.Message);
}
finally
{
rdaNW.Dispose();
}