471,306 Members | 1,260 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 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 1402
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tabo | last post: by
1 post views Thread by VM | last post: by
11 posts views Thread by Keith | last post: by
2 posts views Thread by =?Utf-8?B?RnJlZW1hbg==?= | last post: by

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.