01.
public
partial
class
Form2 : Form
02.
{
03.
public
Form2()
04.
{
05.
InitializeComponent();
06.
}
07.
public
string
postID =
""
;
08.
09.
private
void
Form2_Load(
object
sender, EventArgs e)
10.
{
11.
12.
this
.dataTable1TableAdapter.Fill(
this
.dATA_ALSDataSet.DataTable1);
13.
14.
}
15.
16.
private
void
dataTable1DataGridView_CellClick(
object
sender, DataGridViewCellEventArgs e)
17.
{
18.
postID =
this
.dataTable1DataGridView[1, e.RowIndex].Value.ToString();
19.
Close();
20.
}
21.
22.
private
void
button1_Click(
object
sender, EventArgs e)
23.
{
24.
25.
dataTable1BindingSource.Filter =
"PostCode like '%"
+ textBox1.Text +
"%' OR Post_Province like '%"
+ textBox1.Text +
"%' OR Post_Amphur like '%"
+ textBox1.Text +
"%' OR Post_PostOffice like '%"
+ textBox1.Text +
"%'"
;
26.
}
27.
}