Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

How to display data from db in list

$
0
0

Hi,

My code:

    public List<Voznik> voznik(string username, string password, int IdPodjetja)
    {
        Voznik result = new Voznik();
      //  if (Membership.ValidateUser(username, password) && IdPodjetja != null)
       // {
           //voznik
            var result = (from c in db.tbl_zaposlenis
                         where c.Idkreiranopodjetje == IdPodjetja
                         orderby c.Priimek
                         select new 
                         {
                             ID = c.ID,
                             ImeVoznik = c.Priimek + " " + c.Ime

                         });

            //foreach (var item in result)
            //{

            //}


       // }
        return result;
    }
    public class Voznik
    {
        public int ID { get; set; }
        public string Priimek { get; set; }
        public string Ime { get; set; }
        public string Naslov { get; set; }
        public int PostnaStevilka { get; set; }
        public string Kraj { get; set; }
        public string DavcnaStevilka { get; set; }
        public string DelovnoMesto { get; set; }
        public bool chkOdredilPotovanje { get; set; }
        public bool chkRezident { get; set; }

        public string ImeVoznik { get; set; }
    }

I need to display all from db in list.

How to do this?


Viewing all articles
Browse latest Browse all 1698

Trending Articles