This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have a very strange problem when using a BindingSource. My database has many tables, about ten of them are linked to forms using Lightspeed and a BindingSource, and they all work great. However, today, I tried to use a BindingSource to connect another Lightspeed class to a form. I created the Project Data Source as usual, and when expanded, I can see all the fields, and all looks good. I then added the BindingSource control to the form, again no problem. Then I try to set the DataSource value of the BindingSource to the newly created Project Data Source. When I do, I immediatly receive a "Object reference not set to an instance of an object" error. I thought maybe I did something wrong on this form, so I opened a form which previously worked, and tried to set the DataSource of the BindingSource control, I received the same error message. So then I deleted the newly created Project Data Source, and everything returns to normal, I can set the datasource for any BindingSource control on any form. I then recreated the Project Data Source with the required table, and straight away if I try to set the DataSource of any BindingSource control I receive the same error message. I have confirmed, there are no "old dead" data sources in the Project, a common reason for this error message. I have alse checked the database, there are no unusual field types etc. I am using the SQL Server 2005 provider. I have attached a screen print of the relevant part of the model. I would welcome any advice that anyone can offer as to why I cannot bind this Lightspeed class.
|
|
|
Please disregard the above. Last night, after completing the above request for help, I gave up and switched off my computer, this morning, I opened the project and decided to investigate further, and to my surprise, it worked first time. I am at a loss to explain this, I guess it must go down as one of those "undocumented features" in VS2008. I apologise if I have wasted anyones time with this. In future, I will try to restart the computer before reporting any similar problems.
|
|