Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute()> _
      Public Property Item() As String
           Get
               Return CType(Me(Me.tableSpDet.ItemColumn), String)
           End Get
           Set(ByVal value As String)
               Me(Me.tableSpDet.ItemColumn) = value
           End Set
       End Property


ERROR:(WARNING)
property 'Item' shadows an overloadable member declared in the base class 'DataRow'. If you want to overload the base method, this method must be declared 'Overloads'.


I created data set "TransportDataSet.xsd".In this designer.vb page, i got error like above lines..............................................
Posted
Updated 8-Jun-12 19:35pm
v2

1 solution

The TypedDataSetDesigner creates a Class for the DataRow inherited from DataRow class like
VB
Partial Public Class SpDetRow
        Inherits Global.System.Data.DataRow


with a Property for each field of the DataBase with the Field name as follows:
VB
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Property Name() As String
   Get
       Return CType(Me(Me.tableSpDet.NameColumn), String)
   End Get
   Set(ByVal value As String)
       Me(Me.tableSpDet.NameColumn) = value
   End Set
End Property

Similarly in the above case it has created a Property Item for the field Item of the Database.

But the base class DataRow has a property Item as explained here
http://msdn.microsoft.com/en-us/library/system.data.datarow.aspx#Y0[^] hence the above error may be thrown.

To avoid that error try renaming the Field name in the DataBase from Item to say SpDetItem and generated the typed DataSet again from the DataBase, so that the designer will generate the Property for SpDetItem instead of Item, so that the above conflict can be resolved.

I think it may be helpful.
 
Share this answer
 
v2
Comments
Shahin Khorshidnia 9-Jun-12 2:57am    
Perfect
VJ Reddy 9-Jun-12 3:05am    
Thank you very much, Shahin :)

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