示例#1
0
        public List <Esporte> Esportes()
        {
            List <Esporte> lista = new List <Esporte>();

            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = connection;
            cmd.CommandText = @"select * from esportes";

            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                Esporte e = new Esporte();
                e.Id_Esporte        = (int)reader["id"];
                e.Descricao_Esporte = (string)reader["descricao"];
                lista.Add(e);
            }

            return(lista);
        }
示例#2
0
文件: Evento.cs 项目: Aberos/Inter
 public Evento()
 {
     esporte     = new Esporte();
     local       = new Local();
     organizador = new Organizador();
 }