Each device must register with the server before establishing a connection.
To register the device with the server during the initial application startup, use the RegisterApplication method in the Sybase.Mobile.Application class. You do not need to use the RegisterApplication method for subsequent application start-ups. The RegisterApplication method automatically starts the connection to complete the registration process.
Call the generated database's SetApplication method before starting the connection or registering the device.
// Initialize Application settings
Application app = Application.GetInstance();
// The identifier has to match the
// application ID deployed to the SAP Mobile Server
app.ApplicationIdentifier = "SMP101";
IApplicationCallback appCallback = new MyApplicationCallback();
app.ApplicationCallback = appCallback;
// set connection properties, login credentials, etc
...
SMP101DB.SetApplication(app);
if (app.RegistrationStatus != RegistrationStatus.REGISTERED)
{
// If the application has not been registered to the server,
// register now
app.RegisterApplication(<timeout_value>);
}
else
{
// start the connection to server
app.StartConnection(<timeout_value>);
}