编码新手...如何从SQL查询中获取下拉列表选项。 [英] New to coding... How to source dropdown list options from SQL query.

查看:147
本文介绍了编码新手...如何从SQL查询中获取下拉列表选项。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将SQL查询中的值放在网页的下拉列表中。我在web.config文件中创建了连接,并且能够从我的页面上的查询中呈现值,但无法找出我的下拉列表问题。我在Visual Studio 2012中工作,页面是CSHTML。



提前感谢您的帮助!



James

I need to have values from a SQL query be in a dropdown list on my webpage. I created the connection in the web.config file and have been able to render values from the query on my page, but can't figure out my dropdown list problem. I'm working in Visual Studio 2012 and the page is in CSHTML.

Thank you in advance for your help!

James

推荐答案

请参阅这些链接尝试在您的代码中实现这些链接,如果您在此处的任何特定部分仍有任何问题:)



如何在ASP.NET MVC Razor视图中填充DropDownList?

将DropDownList和ListBox与ASP.NET MVC一起使用

ASP.NET MVC SELECTLIST,SELECTEDVALUE和DROPDOWNLISTFOR

基于另一个下拉列表选择mvc中的绑定下拉列表edvalue使用json

为ASP.NET MVC中的枚举创建DropDownList
See These Links try these to implement in your code and if still you have any issues in any specific portion post here :)

How to Populate DropDownList in ASP.NET MVC Razor View?
Using the DropDownList and ListBox with ASP.NET MVC
ASP.NET MVC SELECTLIST, SELECTEDVALUE, AND DROPDOWNLISTFOR
Binding dropdownlist in mvc based on another dropdownlist selectedvalue using json
Creating a DropDownList for Enums in ASP.NET MVC


这篇关于编码新手...如何从SQL查询中获取下拉列表选项。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆