Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 8th, 2007, 05:26 AM
Registered User
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to LWWVB
Default How to call InitializeComponent function?

In a winform project,Add a new xsd(Typed Dataset) file at project.
Then open DataSet1.cs project file,Show Designer and Properties toolbox.
Click events button in Properties toolbox,Select and double click Initialized event.Vs 2005 automatic Create following in DataSet1.cs.

    public void InitializeComponent()
    {
      ((System.ComponentModel.ISupportInitialize)(this)) .BeginInit();
      //
      // DataSet1
      //
      this.CaseSensitive = true;
      this.Initialized += new System.EventHandler(this.DataSet1_Initialized);
      ((System.ComponentModel.ISupportInitialize)(this)) .EndInit();

    }

Now,I add below content to DataSet1.cs document...
private void DataSet1_Initialized(object sender, System.EventArgs e)
{
  ...//My initialized code
}

But,during the do the project and create a new DataSet1 object,we find InitializeComponent method don't do it at all.
How to create DataSet1 object to immediate run the InitializeComponent method?


 
Old November 9th, 2007, 06:51 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Are you adding the dataset to the form by dragging the DataSet object from the toolbox? When I do this it work fine, the above code in not generated in DataSet1.cs, but in Form1.cs.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Call to function Awkuzu BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 September 19th, 2007 06:13 PM
Call a Function stealthdevil Access VBA 2 November 2nd, 2006 10:38 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
Delete InitializeComponent() ? organicglenn BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 30th, 2004 02:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.