我试图使用从我的Web窗体上的下拉列表中选择的值创建到期日期,但是我无法连接Month变量值和Year变量值。我收到错误:错误操作符'&'未为'String'和System.Web.UI.WebControls.ListItem'类型定义。我也尝试过使用“+”,但得到相同的错误。连接变量
这里是我的代码:
Dim Month = monthDropDownList.SelectedValue
Dim Year = yearDropDownList.SelectedItem
Dim MonthYear = Month & Year
Dim ExpirationDate As Date = MonthYear
任何帮助将不胜感激。
yearDropDownList.SelectedItem.ToString() – Steve
是固定的错误。谁知道这很简单。非常感谢您的帮助。 – Stizz1e