Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Form Inheritence

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom Donohue - 22 Sep 2004 05:03 GMT
I have a base form in VB.Net (Name and address). It has datasets.
I inherit this form and add add'l Info (ie: Phone Numbers)
I inherit from this form and add specific logic for the business need.
I don' t think I need to discuss the advantages of inheritance within this
forum, so here is the problem:

The form was originally designed in .Net 1.0 and upsized to .Net 1.1
The designer reconfigures all of the code such that sometimes (very
frustrating to debug), the redisigned code tries to reinitialize the dataset
which was inherited from the base form. This causes a runtime error since we
are trying to initialize a datarelation which has already been initialized.

Any Thoughts?
"Jeffrey Tan[MSFT]" - 23 Sep 2004 03:39 GMT
Hi Tom,

Based on my understanding, you migrate your .Net Framework1.0 code to .Net
1.1, then you meet some runtime error of initializing dataset.

First, is the dataset a typed dataset(generated by IDE?) or untyped? Also,
what does "reinitialize the dataset which was inherited from the base form"
mean? How does a dataset inherit from a form?
I think I still have some understanding issue about your problem, can you
provide me some more detailed information about your problem, then I can
understand it well and help you out. Thanks.

I suppose you use typed dataset in your application, then can you paste
some reproduce steps or sample code snippet to help us to reproduce this
issue? Thanks again.

=================================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Tom Donohue - 20 Oct 2004 16:15 GMT
Hi Jeffrey:

Sorry I couldn't reply soon, but I appreciate your response. Here is a
little more information.

1. I am using a typed dataset
2. Build a windows form and a typed dataset
3. Put the dataset in the form
4. Create a new inherited windows form which inherits from the form in step 2.
5. Save

If you open/close the form and/or open/close Studio, I am having intermitent
problems where the designer is trying to initialize the dataset in the child
form. This causes an error because the dataset was already initialized upon
instantiation of the parent.

I'm dealing with a rather complicated form with user controls and external
references so it would be difficult to post up the actual problem. I'm
currently rebuilding the forms from scratch to see if it doesn't clear up. If
this rebuild still causes problems, I'll attempt to build a small demo.

If you can make heads or tails out of the above and have any suggestions,
they would be appreciated.

Thanks,

Tom

> Hi Tom,
>
[quoted text clipped - 22 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 26 Oct 2004 08:37 GMT
Hi Tom,

Sorry for letting you wait for so long.

In your parent form, do your initialize the typed dataset in parent form's
constructor? Because the inherited form will call the parent form's
constructor, so the initialization will occurs twice. Can you show me why
you want to inherit from the parent form? Maybe we can find a way to
workaround this.

Also, because this behavior only occurs at design-time, we may remove the
inialization code in parent form from constructor to Form_Load method, then
we may use Form.Site.DesignMode property to check if it is design-time and
disable this code snippet at design-time.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

"Jeffrey Tan[MSFT]" - 27 Sep 2004 03:01 GMT
Hi Tom,

Does my reply make sense to you? Is your problem resolved?

Please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.