Visual Studio won't update properties of my Data Source
Asked Answered
S

6

19

I am using my class "Invoice" as a Data Source. But after adding more properties to it, Visual Studio refuses to refresh the data source and I can't find the new properties in my data source.

Tried restarting project, deleting and adding object as datasource again. Did not work.

Suture answered 11/4, 2011 at 13:25 Comment(5)
Are you getting an error? If So what is the error message?Bugeye
No error. Just won't show the new properties even after refreshing.Suture
Is the Invoice class in the same assembly as the data source?Eastertide
Yes it is. It did update now after i compiled once, but there has to be a better solution?Suture
Sounds like your intellisense was out of date. When odd things like this happen the first thing I do is a rebuild.Linctus
S
20

Problem was Intellisense going out of date due to changes in the Data Source.

Solution was to simply to rebuild the project.

Suture answered 29/4, 2011 at 12:19 Comment(4)
Visual Studio 2010 requires the project to be cleaned and rebuilt every time the data model changes for intellisense to work.Oddment
Had a similar situation with VS2012. The cleaning was required, then the rebuild did the trick.Darya
In VS2013 Update 3 A rebuild wasn't enough. I had to restart VS.Handout
I'll second @ElanHasson, needed to rebuild and restart all VS instances.Downstroke
G
1

Are you using any source control ? also, .datasource file gets created under Properties folder, try to remove and re-add the object by opening Data Sources tab.

also your new properties in Invoice should have access modifiers (at least { get;} ) otherwise it might not show up AFAIK.

Guideline answered 11/4, 2011 at 14:14 Comment(1)
Where is the Data Sources tab?Equiponderance
I
1

OMGKurtNilsen is right:

You don't need to delete and re-create the datasource - a project rebuild will do!

I tested it with a datasource in a VS 2010 project, that takes its data from a simple C# object.

Irita answered 26/7, 2013 at 8:45 Comment(0)
I
1

That problem ocurrs in report designer where use data source object, when i add or remove a property in my class and i refresh the data source in data panel on report data sources, this don't show last changes. I resolved adding reference to Microsoft.CShart assembly. You could try this to resolve you problem.

Inalterable answered 26/7, 2017 at 4:39 Comment(0)
C
0

If you keep your datasource and your form element in different class libraries, sometimes you have to rebuild your class libraries, this situation mostly occurs when the reference bound with static way.

Cadena answered 15/12, 2011 at 21:15 Comment(0)
J
0

This what you should do.

Refresh the Data Source, Remove the entity and Add it back in before it would change.

John answered 19/6, 2012 at 1:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.