fork download
  1. using System;
  2.  
  3. public static class Program {
  4. public static void Main() => new DAL.DadosConexao(true, null);
  5. }
  6.  
  7. namespace DAL {
  8. public class DadosConexao {
  9. private string servidor;
  10. private bool isServ;
  11.  
  12. public DadosConexao(bool isServ, string servidor) {
  13. this.isServ = isServ;
  14. this.servidor = servidor;
  15. }
  16.  
  17. public string StringConexao {
  18. get {
  19. if (!isServ) servidor = Environment.MachineName.ToString();
  20. return "Data Source=" + servidor +
  21. "\\MINHAINSTANCIA;" +
  22. "Initial Catalog=MINHABASE;" +
  23. "Persist Security Info=True;" +
  24. "User ID=sa;" +
  25. "Password=123456";
  26. }
  27. }
  28. }
  29. }
  30.  
  31. //https://pt.stackoverflow.com/q/93033/101
Success #stdin #stdout 0.02s 13864KB
stdin
Standard input is empty
stdout
Standard output is empty