hello Richard,
First of all, tahanks for giving your time,
"PhysicalInventoryfrm" is the form in VB.net and "drpInvName" is the
combobox in it having modifier 'Friend' .
Same thing i did in C#, created a form "PhysicalInventoryfrm" and kept a
combo box "drpInvName" on it. Now from the seconnd form i am trying to set
the datasource of this combobox.
It this point it gives me compile time error.
However the code in VB.net runs fine.
Thanks again and also in advance
--
Sunil Pandita
Software Engineer
(OTS Solutions Pvt. Ltd. )
"Richard Blewett [DevelopMentor]" wrote:
"sunil" <su***@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com... 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.Data Source =
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
--
Sunil Pandita
Software Engineer
(OTS Solutions Pvt. Ltd. )
Can we assume that this code is executing in an assembly other than the one
which declares PhysicalIniventoryfrm?
What is the protection level of PhysicalIniventoryfrm and its member
drpInvName?
Regards
Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk