473,509 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception during DataBindings.Add()

Hi,

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.Clear();
timePicker.DataBindings.Add("Value", dv,
TimeColumn.ColumnName);

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.>>
at
System.ComponentModel.ReflectPropertyDescriptor.Se tValue
(Object component, Object value)
at System.Windows.Forms.Binding.SetPropValue(Object
value)
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)
at
System.Windows.Forms.ListManagerBindingsCollection .AddCore
(Binding dataBinding)
at System.Windows.Forms.BindingsCollection.Add(Bindin g
binding)
at System.Windows.Forms.BindingContext.UpdateBinding
(BindingContext newBindingContext, Binding binding)
at System.Windows.Forms.Binding.SetControl(Control
value)
at
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)
at
<<...Application code from here to end of trace...>>

Nov 15 '05 #1
0 1451

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
15797
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
1
291
by: Chris | last post by:
Hi, I have a DB-table 'AirplaneTypes' that has to 2 fields that form the primary key : 'at_name' and 'at_model' both in the DB defined as type : char 15 MyWinform client : void...
0
5620
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
9
2668
by: HAN(removethis)twister | last post by:
I've tried to create 11 textboxes as variables (not actually visible in the program, not in Windows Form Designer) and have set DataBindings to the text properties of the TextBoxes BUT according to...
7
1698
by: ZorpiedoMan | last post by:
Well, I'm still wondering around in the "land of the lost exception"... It seems that controls that are bound to a class and the class throws an error in the SET method of the bound member, the...
12
5011
by: Coen | last post by:
Hi, I'm dealing with a master-detail relationship. A datagrid bound to the detail data. When navigating through the records (next record: Me.BindingContext(mDv1).Position += 1), I notice a delay...
0
279
by: Jarod | last post by:
I got following expeption: Always when I try to update gridView using detailsView on the SECOND time. So I made 1 update, and I try to make another one and than boom... I don't add any controls...
0
2281
by: XenReborn | last post by:
Ok this should be simple. I made a form, added a combobox (for selecting items to edit, not for updating fields), several textboxes, a few checkboxes etc. On formshow it connects to my database,...
3
1181
by: hathan | last post by:
Can anyone explain why this code doesnt delete from the database. Some times it works and some times it errors i am confused. Private Sub DeleteBtn_Click(ByVal sender As System.Object, ByVal e As...
0
7136
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7412
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3216
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3203
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.