?
Solved

C# LINQ get value in controller

Posted on 2012-08-15
1
Medium Priority
?
475 Views
Last Modified: 2012-08-15
Hi,

Ive got table with:  ID, Value
ID gets posted to contoller with a dropdownlist

now i want to insert Value into another table, but how can i convert ID into Value before i insert?

Thanks!
0
Comment
Question by:DATA99
1 Comment
 

Accepted Solution

by:
DATA99 earned 0 total points
ID: 38296157
never mind, found it:

var Value= db.Types.FirstOrDefault(b => b.ID.ToString() == ID);
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Loops Section Overview
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question