Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am Using MVC2 in my Application I want to show Data in a drop down list from a MSsql-2008 database, After that I want to insert the same data from same drop down list into another MSsql table. The Tables have a relation among them.

How Can i do That?
Please Help me?
Posted
Updated 22-Oct-13 23:27pm
v2
Comments
zaksan 24-Oct-13 0:45am    
<div class="editor-field">
<%: Html.TextBoxFor(model => model.Name)%>
<%: Html.ValidationMessageFor(model => model.Name) %>
</div>
Can I use Drop Down List In My Create view Insted of this?
zaksan 29-Oct-13 5:01am    
I have a Table with several fields,in the table in a field(data type varchar()) I want to save Image in my MVC2 application Using this field. How can I do that? I am New in MVC.Please help me with an example step by step.

1 solution

Hope below url helps
http://www.c-sharpcorner.com/uploadfile/2124ae/populating-dropdown-list-in-Asp-Net-mvc-2-using-entity-framework-4/[^]

Here they are using EF, but its upto you, you can use your own logic to get the data from db. follow thw way how they are binding data from a model.
 
Share this answer
 
Comments
zaksan 24-Oct-13 0:44am    
Thanks, But I can do that. I want to save data that is showing in the Drop down list into another table of Same database using create view.

Can I use Drop down list insted of
"<div class="editor-field">
<%: Html.TextBoxFor(model => model.Name)%>
<%: Html.ValidationMessageFor(model => model.Name) %>
</div>"
This In Create View?
Please help...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900