public class ServiceInterface : System.Web.Services.WebService
{
public string gentleConfig;
public string connStr;
public bool ConnectToDatabase()
{
Log.Debug("");
Log.Debug("RemoteControl.IsConnected=" + RemoteControl.IsConnected.ToString());
try
{
if (RemoteControl.IsConnected)
return true;
string provider = "";
RemoteControl.HostName = Environment.MachineName;
RemoteControl.Instance.GetDatabaseConnectionString(out connStr, out provider);
Gentle.Framework.ProviderFactory.SetDefaultProviderConnectionString(connStr);
}
catch (Exception exc)
{
Log.Error("TvWishListMP: Connecting to Tvserver database failed");
Log.Error("Exception is:" + exc.Message);
return false;
}
Log.Debug("Connected to Tv database");
return true;
}
}