TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
GAYAN WIJEKOON
NA
104
1.7k
Asp.net MVC without Entity Framwork
Jul 14 2018 9:46 AM
How to create Dropdown List from SQL database table column without using Entity Framwork.
I have Customer table and Branch table in my Database. CustomerID is a Foriegn Key of Branch table.
I want to create Branch Adding form(BranchId,CustomerId,Name) which has CustomerID of registered customers as a Dropdown List.
public
class
BranchModel
{
public
int
bid {
get
;
set
; }
[Required(ErrorMessage =
"Please Select Customer ID !"
)]
[DisplayName(
"Customer ID"
)]
public
Nullable<
int
> cid {
get
;
set
; }
[Required(ErrorMessage =
"Please Enter Branch Name !"
)]
[DisplayName(
"Branch Name"
)]
public
String name {
get
;
set
; }
[NotMapped]
public
List
<
CustomerModel
>
CidList {
get
;
set
; }
}
Branch Model.
how to create Controller and View
Reply
Answers (
2
)
AspNetCore 2, Post size
unable to send data from view to controller