This is my code :
private async void ceck_connection()
{
try
{
isconnected = false;
btndownload.Source = "downloadr";
string ipp="";
if (Application.Current.Properties.ContainsKey("ip"))
{
string[] st = Application.Current.Properties["ip"].ToString().Split(new char[] { 'ò' });
ipp = st[0];
}
FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
cs.UserID = "SYSDBA";
cs.Password = "xxxxxxxx";
cs.Database = ipp + @":C:\FirebirdSQL\Photo.FDB";
cs.Charset = "UTF8";
cs.Pooling = false;
cs.Dialect = 3;
cs.PacketSize= 32767;
cs.ServerType = FbServerType.Default;
FbConnection conn = new FbConnection(cs.ToString());
await conn.OpenAsync();
await conn.CloseAsync();
isconnected = true;
btndownload.Source = "downloadw";
}
catch (Exception ex)
{
isconnected = false;
btndownload.Source = "downloadr";
await DisplayAlert("", ex.Message, "Conjtinua");
}
}