如何在表单上绑定到日期控件? [英] How Do I Bind To Date Control On A Form?
本文介绍了如何在表单上绑定到日期控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是编程新手,使用VS 2008.Below代码行在运行时抛出未处理的异常
I am new in programming,using VS 2008.Below line of code throws unhandled exception at runtime
Me.dtpRegDate.DataBindings.Add("text", ObjDataView, " P_Date")
然后我收到这条消息:
。无法绑定到属性或列P_Date在DataSource上。参数名称:dataMember
我哪里弄错了?
And then i get this message:
. Cannot bind to the property or column P_Date on the DataSource. Parameter name: dataMember
Where did i get it wrong?
推荐答案
取出空格。
Take out the space.
Me.dtpRegDate.DataBindings.Add("text", ObjDataView, " P_Date")
成为
Becomes
Me.dtpRegDate.DataBindings.Add("text", ObjDataView, "P_Date")
问题是空间在列名称之前,P_Date。我在字母P之前关闭了空格并再次成功运行程序。
The Problem is the space before the column name,P_Date. I closed the space before letter P & successfully ran the program again .
这篇关于如何在表单上绑定到日期控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文