在C#.NET Web表单上填写阵列组合 [英] Fill combo by an array on a web form in c # .net
本文介绍了在C#.NET Web表单上填写阵列组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有四个变量的长期DateTime类型,我想(用C调),该组合应该显示当月相应的日期时间变量的名称,以填补组合与网页上的这四个值的帮助下, 如何IDO呢?
I have four variables of Long DateTime type, I want to fill combo with the help of these four values on a web page (using c sharp), The combo should show the name of Month of corresponding datetime variable, How can ido that?
推荐答案
您还可以使用一个DataTable用于此目的。 简单的说,
You can also use a Datatable for this purpose. Simply say,
ddlName.DataSource = dataableName;
ddl.DataValueField = "ColumnName";
ddl.DataTextField = "ColumnName";
存储在各列所需的值,只是写自己对文本或值的字段名。
Store the desired Values in respective columns and simply write their names against text or value fields.
这篇关于在C#.NET Web表单上填写阵列组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文