Click here to Skip to main content
15,887,849 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi folks,

When trying to create a DataSource in Visual Basic 2012 Ultimate, I get the below error. I have the database created and the tables etc. But just trying to create a DataSource.

unable to cast object of type 'System.Object[]' to Type 'system.ComponentModel.AttributeProviderAttribute[]


Has anyone experienced this before and know how to resolve it? I have searched Google etc and to very little result.
I have recreated the project again from scratch and still getting it.

Thanks in advance.
Posted
Comments
AndrewCharlz 11-Mar-14 23:23pm    
please check the column datatype
Dan O'Riordan 12-Mar-14 1:42am    
Hi Andrew.
Datatypes are all fine. ID is set to Int. Text Boxes are set to varchar(50) and large information textbox is set to text.
Dan O'Riordan 12-Mar-14 2:00am    
I have also opened another project I did last week with DataSources etc, and the same error popped up when loading the project.
AndrewCharlz 12-Mar-14 2:04am    
in ur sql query cast all columns to varchar eg: convert(varchar, colname) as 'Colname'

1 solution

Strange.
It seemed to have solved itself.
I closed down VS altogether, rebooted the laptop, opened VS again, opened an old project, which worked with DataSource and then opened the new project, where I was finally able to add a DataSource.

Hope this helps someone with a similar issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900