Advertisement
Guest User

Untitled

a guest
Jan 5th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. public bool LogearseFirebird(string Cif, string PWD)
  2. {
  3. bool oReturn = false;
  4. string connString =
  5. "User=SYSDBA;" +
  6. "Password=masterkey;" +
  7. "Database=C:\FirebirdDB\USUARIOS.FDB;" +
  8. "DataSource =localhost;" +
  9. "Port=3050;" +
  10. "Dialect=3;" +
  11. "Charset=NONE;" +
  12. "Role=;" +
  13. "Connection lifetime=15;" +
  14. "Pooling=true;" +
  15. "MinPoolSize=0;" +
  16. "MaxPoolSize=50;" +
  17. "Packet Size=8192;" +
  18. "ServerType=0;";
  19.  
  20.  
  21. FbConnection conn = new FbConnection(connString);
  22. conn.Open();
  23.  
  24. String sql = "SELECT NOMBRE FROM TBL_USUARIOS WHERE CIF=" + Cif + "AND CONTRASENYA=" + PWD;
  25. FbCommand com = new FbCommand(sql, conn);
  26. FbDataReader dr = com.ExecuteReader();
  27. if (dr.Read())
  28. {
  29. oReturn = true;
  30. }
  31. dr.Close();
  32. conn.Close();
  33. Console.ReadLine();
  34. return oReturn;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement