SqlCeReplication.InternetUrl 属性
指定连接到 SQL Server Compact Edition Server Agent 时使用的 URL。
命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 system.data.sqlserverce.dll 中)
语法
声明
Public Property InternetUrl As String
用法
Dim instance As SqlCeReplication
Dim value As String
value = instance.InternetUrl
instance.InternetUrl = value
public string InternetUrl { get; set; }
public:
property String^ InternetUrl {
String^ get ();
void set (String^ value);
}
/** @property */
public String get_InternetUrl ()
/** @property */
public void set_InternetUrl (String value)
public function get InternetUrl () : String
public function set InternetUrl (value : String)
不适用。
属性值
URL 字符串。
备注
此属性是必需的。如果希望重写默认端口,可包含一个端口号。(默认 HTTP 端口为 80,默认 HTTPS 端口为 443。)例如,在 IIS 服务器上使用端口 810 时,可将 InternetUrl 设置为“http://yourserver:810/ssce/sqlcesa30.dll”。
示例
下面的示例设置 SqlCeReplication 对象的 InternetUrl 属性。
Dim repl As SqlCeReplication = Nothing
Try
' Instantiate and configure SqlCeReplication object
'
repl = New SqlCeReplication()
repl.InternetUrl = "https://www.adventure-works.com/sqlmobile/sqlcesa30.dll"
repl.InternetLogin = "MyInternetLogin"
repl.InternetPassword = "<password>"
repl.Publisher = "MyPublisher"
repl.PublisherDatabase = "MyPublisherDatabase"
repl.PublisherLogin = "MyPublisherLogin"
repl.PublisherPassword = "<password>"
repl.Publication = "MyPublication"
repl.Subscriber = "MySubscriber"
repl.SubscriberConnectionString = "Data Source=MyDatabase.sdf"
' Create the local SQL Mobile Database subscription
'
repl.AddSubscription(AddOption.CreateDatabase)
' Synchronize to the SQL Server to populate the Subscription
'
repl.Synchronize()
Catch
' Handle errors here
'
Finally
' Dispose the repl object
'
repl.Dispose()
End Try
SqlCeReplication repl = null;
try
{
// Instantiate and configure SqlCeReplication object
//
repl = new SqlCeReplication();
repl.InternetUrl = "https://www.adventure-works.com/sqlmobile/sqlcesa30.dll";
repl.InternetLogin = "MyInternetLogin";
repl.InternetPassword = "<password>";
repl.Publisher = "MyPublisher";
repl.PublisherDatabase = "MyPublisherDatabase";
repl.PublisherLogin = "MyPublisherLogin";
repl.PublisherPassword = "<password>";
repl.Publication = "MyPublication";
repl.Subscriber = "MySubscriber";
repl.SubscriberConnectionString = "Data Source=MyDatabase.sdf";
// Create a local SQL Mobile Database subscription
//
repl.AddSubscription(AddOption.CreateDatabase);
// Synchronize to the SQL Server database
//
repl.Synchronize();
}
catch (SqlCeException)
{
// Handle errors here
//
}
finally
{
// Dispose the repl object
//
repl.Dispose();
}
平台
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
Windows Vista、Microsoft Windows XP SP2 和 Windows Server 2003 SP1 支持 Microsoft .NET Framework 3.0。
版本信息
.NET Framework
受以下版本支持:3.0
.NET Compact Framework
受以下版本支持:2.0、1.0
请参见
参考
SqlCeReplication 类
SqlCeReplication 成员
System.Data.SqlServerCe 命名空间