Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. string conDDNS;
  2. FbConnection conexaoDDNS;
  3.  
  4. protected void Abrir_Fechar_Click(object sender, EventArgs e)
  5. {
  6. try
  7. {
  8. this.conDDNS = "DRIVER=InterBase/Firebird(r) driver;User=SYSDBA;Password=masterkey;Database=localhost:C:/AdCom/ADCOM.FDB";
  9.  
  10. this.conexaoDDNS = new FbConnection(conDDNS);
  11. this.conexaoDDNS.Open();
  12. ListItem item = new ListItem("Conexão aberta");
  13. ListBox1.Items.Add(item);
  14.  
  15. this.conexaoDDNS.Dispose();
  16. this.conexaoDDNS.Close();
  17. ListItem item2 = new ListItem("Conexão fechada");
  18. ListBox1.Items.Add(item2);
  19.  
  20. }
  21. catch (Exception erro)
  22. {
  23. ListItem item = new ListItem(erro.ToString());
  24. ListBox1.Items.Add(item);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement