473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to generate code in Form_Load method. NOT in InitializeComponent()

In VS2005, there is a so personal change about Binding Data.

IDE will gernerate the code about Adapter.Fill(DataSet) automatically. such
as:

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the nwindDataSet.Categories' table. You can move, or remove it, as needed.
this.categoriesTableAdapter.Fill(this.nwindDataSet .Categories);

}
}
}

OK, now, How can I gernerate my expected code in Form_Load() in IDE Design Time????
Regards

Nov 30 '05 #1
1 1456
There are 2 ways:
1 - you can write VB macro for the IDE that will do that. It will utilize VS
object model, known as DTE
2 - you can write VS addin, that will do the same ( use DTE ), but it will
use any .NET language.
--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"JacksonYin" <Ja************@hotmail.com> wrote in message
news:Om****************@TK2MSFTNGP09.phx.gbl...
In VS2005, there is a so personal change about Binding Data.

IDE will gernerate the code about Adapter.Fill(DataSet) automatically. such
as:

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the
nwindDataSet.Categories' table. You can move, or remove it, as needed.
this.categoriesTableAdapter.Fill(this.nwindDataSet .Categories);

}
}
}

OK, now, How can I gernerate my expected code in Form_Load() in IDE Design
Time????
Regards


Nov 30 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Colin | last post by:
Hi there, I really need your help on this. I'm trying to learn to using the VS.2003 to create a User Control. In my aspx code has no problem to use the property "grossWaye" that has "register" in...
3
by: Tabo | last post by:
when i build the project using C#, the code in InitializeComponent lost sometimes. Is it a bug?? if yes, can some method fix it? thanks for help. Tabo
1
by: VM | last post by:
How can I manually run the code of an event? For example, I want to run a Mouse click event without actually clicking doing a Mouse click? Thanks.
8
by: edster | last post by:
A *lot* of our teams code is being deleted from the InitializeComponent() section of a winform, such as Grid settings, event handler hooks, layout settings etc. This mainly seems to happen to 3rd...
6
by: cpnet | last post by:
I've authored a custom web component (a non-ui component kinda like a DataSet) and so far it's working. When my web component is added to the web form in the designer from the toolbox, the...
11
by: Keith | last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
13
by: cj | last post by:
In a project done in 2003 about a year ago I was told to add the SocketWrench code below into the Windows Form Designer generated code area as shown below. #Region " Windows Form Designer...
5
by: Bjarke | last post by:
I know how to do it in vs 2003, please help!
2
by: =?Utf-8?B?RnJlZW1hbg==?= | last post by:
Hi, I'm new to vb.net. How to prevent vb.net to automatic execute code in design time? When I open a form design view in VS2005, vs pop up an error message: "Could not load file or assembly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.