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

J

JacksonYin

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
 
V

Vadym Stetsyak

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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top