在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.