By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,899 Members | 1,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,899 IT Pros & Developers. It's quick & easy.

Exception during DataBindings.Add()

P: n/a

I am trying to bind a datetime picker control to a column
in a DataView and I get this exception:

"Object reference not set to an instance of an object."

Pseudo code looks like this:

timePicker.DataBindings.Add("Value", dv,

In the debugger I can see that the view is valid and that
there IS a row of data in the DataView which is
initialized to reasonable values. I can also see that the
ColumnName IS correct and that the column does exist in
the view. I'm not passing anything null into this method
call and yet the call throws a null exception; any ideas?

The method call throws the exception from deep within the
bowels of the framework. Here's a stack trace:

<<Object reference not set to an instance of an object.>>
System.ComponentModel.ReflectPropertyDescriptor.Se tValue
(Object component, Object value)
at System.Windows.Forms.Binding.SetPropValue(Object
at System.Windows.Forms.Binding.PushData()
at System.Windows.Forms.Binding.UpdateIsBinding()
at System.Windows.Forms.Binding.CheckBinding()
at System.Windows.Forms.Binding.SetListManager
(BindingManagerBase bindingManagerBase)
System.Windows.Forms.ListManagerBindingsCollection .AddCore
(Binding dataBinding)
at System.Windows.Forms.BindingsCollection.Add(Bindin g
at System.Windows.Forms.BindingContext.UpdateBinding
(BindingContext newBindingContext, Binding binding)
at System.Windows.Forms.Binding.SetControl(Control
System.Windows.Forms.ControlBindingsCollection.Add Core
(Binding dataBinding)
at System.Windows.Forms.ControlBindingsCollection.Add
(Binding binding)
at System.Windows.Forms.ControlBindingsCollection.Add
(String propertyName, Object dataSource, String dataMember)
<<...Application code from here to end of trace...>>

Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.