简体   繁体   中英

how to bind values in dropdownlist from sql table in MVC4?

I am currently working on matrimonial site registration page... I want to know how to take the values from sql database and bind it to dropdownlist on the registration page? How to bind values to dropdownlist from sql table in c# MVC4?

Q: "how to take the values from sql database"

A: You may use some ORM layer(EntityFramework, Linq2SQL, ...) or native SQL queries executed via SqlDataAdapter .

Q: " how to bind values in dropdownlist from sql table in c# MVC4?"

A: Here is one possibile solution

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM