79077592

Date: 2024-10-11 09:27:27
Score: 0.5
Natty:
Report link

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");
}

}

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: L.Andrea