“Use the new keyword if hiding was intended” warning

前端 未结 4 1398
你的背包
你的背包 2020-12-13 05:32

I have a warning at the bottom of my screen:

Warning 1 \'WindowsFormsApplication2.EventControlDataSet.Events\' hides inherited member \'Syste

4条回答
  •  星月不相逢
    2020-12-13 05:56

    Your class has a base class, and this base class also has a property (which is not virtual or abstract) called Events which is being overridden by your class. If you intend to override it put the "new" keyword after the public modifier. E.G.

    public new EventsDataTable Events
    {
      ..
    }
    

    If you don't wish to override it change your properties' name to something else.

提交回复
热议问题