如何从datadbase填写dropdwon列表? [英] how fill dropdwon list from datadbase?

查看:54
本文介绍了如何从datadbase填写dropdwon列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

// how can i fill dropdown list in department list,standard list, semester list,stream list when i add subject and chapter  //
i have two different table tbl_dipart and chepter //
// department model//

namespace firstapp.Models
{
    public class dipartment  
    {

        public int dip_id { get; set; }

        public string dipart { get; set; }

        public string std { get; set; }

        public string sem { get; set; }

        public string strem { get; set; }
    }
}
// chapter model//

namespace firstapp.Models
{
    public class chepter
    {
        [ForeignKey("dip_id")]
        public int dipart_id { get; set; }

        public int chep_id { get; set; }

        public string subject { get; set; }

        public string chepter { get; set; }

        public List<dipartment> dipartlist { get; set; }

        public List<dipartment> stdlist { get; set; }

        public List<dipartment> semlist { get; set; }

        public List<dipartment> stremlist { get; set; }


    }
}
//please help me //thank you in advance.....

推荐答案

向Google询问 [ ^ ]


http: //www.c-sharpcorner.com/Blogs/12034/bind-dropdownlist-in-mvc-using-Asp-Net.aspx [ ^ ]


这篇关于如何从datadbase填写dropdwon列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆