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
احمد صدقی
NA
106
17.3k
More then one element exception
Mar 6 2019 5:54 AM
I have 2 tables in my database, one is for company and another is for Branch. When i crate a branch i must be select my company, so in that case i would like to take dropdown in my branch form. in dropdown i bind company id and company name from m_com(table)
foreach (var item in brnch)
{
Company company = new Company();
company.com_nam = item.com_nam;
company.com_id = item.com_id;
br.comModel.Add(company);
}
when i click on submit button com_id return with " , " eg: ",05 ". so in that case i get error of more then one variable exception.
public ActionResult Create(Branch model)
{
if (ModelState.IsValid)
{
var temp = Request.Form["com_id"].ToString();
string strNew = temp.Replace(" , ", " ");
m_br brpany = new m_br();
var br = erkDB.m_br.OrderByDescending(x => x.br_id).SingleOrDefault().br_id;
Attachment:
m_brController.zip
Reply
Answers (
5
)
Regarding addEventListener event
EntityFramework.dll but was not handled in user code