G
Guest
hello there
I was doing a project in VB.net and i used the following code to access the
element of the parent form
#################Code #####
DirectCast(Me.Owner, PhysicalInventoryfrm).drpInvName.DataSource =
inventoryCombodataset.Tables(0)
#########
where "PhysicalInventoryfrm" is the class of the Form whose element I want
to access. This worked fine. This piece of code was placed on some other
form.
When i tried to use same technique in C# as follows
((PhysicalInventoryfrm)this.Owner).drpInvName.DataSource =
inventoryCombodataset.Tables(0);
It gave me the compile time error "PhysicalInventoryfrm.drpInvName is
inaccessible due to its protection level." However i tried to change is
modifiers to public,internal etc also, but it didn't work.
Can anyone help me out in this case.
Thanks in advance
I was doing a project in VB.net and i used the following code to access the
element of the parent form
#################Code #####
DirectCast(Me.Owner, PhysicalInventoryfrm).drpInvName.DataSource =
inventoryCombodataset.Tables(0)
#########
where "PhysicalInventoryfrm" is the class of the Form whose element I want
to access. This worked fine. This piece of code was placed on some other
form.
When i tried to use same technique in C# as follows
((PhysicalInventoryfrm)this.Owner).drpInvName.DataSource =
inventoryCombodataset.Tables(0);
It gave me the compile time error "PhysicalInventoryfrm.drpInvName is
inaccessible due to its protection level." However i tried to change is
modifiers to public,internal etc also, but it didn't work.
Can anyone help me out in this case.
Thanks in advance