|
wm6访问sql server数据库,请求高手帮忙!
[复制链接]
if (File.Exists("\\MyDatabase.sdf"))
File.Delete("\\MyDatabase.sdf");
SqlCeEngine engine = new SqlCeEngine("Data Source =\\MyDatabase.sdf;password=test;encrypt database=TRUE");
engine.CreateDatabase();
engine.Dispose();
SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();
rda.InternetUrl = "http://127.0.0.1/WebCe/sqlcesa30.dll";
rda.InternetLogin = "";//IUSR_JYJT-WEBSERVER
rda.InternetPassword = "";
rda.LocalConnectionString = "Data Source=\\MyDatabase.sdf;password=test;";
string strLocalString = "Provider=sqloledb;server=127.0.0.1,8341;database=master;uid=sa;pwd=;";
// 从 SQL Server 下载数据
rda.Pull("sysprotects", "SELECT * FROM sysprotects", strLocalString, RdaTrackOption.TrackingOn, "ErrorTable");
以上代码在wm6模拟器上准备访问远程数据库(sql server 2000),结果出现“将数据发送到运行 IIS 的计算机的请求失败。有关详细信息,请参阅 HRESULT。”
请求高手帮助,小弟非常感谢。。。。
|
|