简体   繁体   English

Visual Studio不会更新我的数据源的属性

[英]Visual Studio won't update properties of my Data Source

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. 但是在向其添加更多属性后,Visual Studio拒绝刷新数据源,我无法在数据源中找到新属性。

Tried restarting project, deleting and adding object as datasource again. 尝试重新启动项目,再次删除和添加对象作为数据源。 Did not work. 不工作。

Problem was Intellisense going out of date due to changes in the Data Source. 问题是Intellisense由于数据源的变化而过时。

Solution was to simply to rebuild the project. 解决方案是简单地重建项目。

OMGKurtNilsen is right: OMGKurtNilsen是对的:

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. 我在VS 2010项目中使用数据源对其进行了测试,该数据源从简单的C#对象获取数据。

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. 此外, .datasource文件在Properties文件夹下创建,尝试通过打开Data Sources选项卡删除并重新添加该对象。

also your new properties in Invoice should have access modifiers (at least { get;} ) otherwise it might not show up AFAIK. 您的Invoice中的新属性也应该具有访问修饰符(至少{ get;} ),否则它可能不会显示AFAIK。

This what you should do. 这是你应该做的。

Refresh the Data Source, Remove the entity and Add it back in before it would change. 刷新数据源,删除实体并在其更改之前将其重新添加。

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. 我解决了添加对Microsoft.CShart程序集的引用。 You could try this to resolve you problem. 您可以尝试这样来解决您的问题。

如果将数据源和表单元素保存在不同的类库中,有时您必须重建类库,这种情况主要发生在以静态方式绑定引用时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM