Partilhar via


Propriedade InternetUrl

Especifica a URL usada para conectar o Agente de Servidor do SQL Server Compact 3.5.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (em System.Data.SqlServerCe.dll)

Sintaxe

'Declaração
Public Property InternetUrl As String
    Get
    Set
'Uso
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);
}
member InternetUrl : string with get, set
function get InternetUrl () : String
function set InternetUrl (value : String)

Valor da propriedade

Tipo: System. . :: . .String
A cadeia de caracteres da URL.

Comentários

Esta propriedade é necessária. Você pode incluir um número de porta, se desejar substituir a porta padrão. (A porta padrão para HTTP é 80 e a porta padrão para HTTPS é 443.) Por exemplo, defina InternetUrl como "http://yourserver:810/ssce/sqlcesa35.dll", onde a porta 810 é usada no servidor IIS.

Exemplos

O exemplo a seguir define a propriedade InternetUrl do objeto SqlCeReplication.

Dim repl As SqlCeReplication = Nothing

Try
    ' Instantiate and configure SqlCeReplication object
    '
    'NOTE: when possible, prompt users to enter security 
    'credentials at runtime. If you store credentials in a file, 
    'you must secure the file to prevent unauthorized access.
    '
    repl = New SqlCeReplication()
    repl.InternetUrl = "https://www.adventure-works.com/sqlce/sqlcesa35.dll"
    repl.InternetLogin = "MyInternetLogin"
    repl.InternetPassword = "<enterStrongPassword>"
    repl.Publisher = "MyPublisher"
    repl.PublisherDatabase = "MyPublisherDatabase"
    repl.PublisherLogin = "MyPublisherLogin"
    repl.PublisherPassword = "<enterStrongPassword>"
    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
    //
    //NOTE: when possible, prompt users to enter security 
    //credentials at runtime. If you store credentials in a file, 
    //you must secure the file to prevent unauthorized access.
    //
    repl = new SqlCeReplication();
    repl.InternetUrl = "https://www.adventure-works.com/sqlce/sqlcesa35.dll";
    repl.InternetLogin = "MyInternetLogin";
    repl.InternetPassword = "<enterStrongPassword>";
    repl.Publisher = "MyPublisher";
    repl.PublisherDatabase = "MyPublisherDatabase";
    repl.PublisherLogin = "MyPublisherLogin";
    repl.PublisherPassword = "<enterStrongPassword>";
    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();
}

Consulte também

Referência

SqlCeReplication Classe

Membros SqlCeReplication

Namespace System.Data.SqlServerCe