01.
private
void
GridBind()
02.
{
03.
try
04.
{
05.
sqlData =
new
StringBuilder();
06.
objConn.Open();
07.
sqlData.Append(AppenSqL.ToString());
08.
da =
new
SqlDataAdapter(sqlData.ToString(), objConn);
09.
ds =
new
DataSet();
10.
da.Fill(ds,
"Upload"
);
11.
GridView1.Visible =
true
;
12.
GridView1.DataSource = ds.Tables[0].DefaultView;
13.
GridView1.DataBind();
14.
Label7.Text = Convert.ToString(ds.Tables[0].Rows.Count);
15.
Label5.Visible =
true
;
16.
Label7.Visible =
true
;
17.
Label9.Visible =
true
;
18.
if
(ds.Tables[0].Rows.Count == 0)
19.
{
20.
MessageShow(
"ไม่พบข้อมูลที่ค้นหา!!!"
);
21.
ListBox1.Items.Clear();
22.
ListBox1.Items.Add(
"Derivatives"
);
23.
ListBox1.Items.Add(
"GMRA"
);
24.
ListBox1.Items.Add(
"ISDA"
);
25.
ListBox1.Items.Add(
"Private Repo"
);
26.
ListBox1.Items.Add(
"Product Program"
);
27.
ListBox1.Items.Add(
"คำสั่งภายใน"
);
28.
Label5.Visible =
false
;
29.
Label7.Visible =
false
;
30.
Label9.Visible =
false
;
31.
}
32.
}
33.
34.
{
35.
MessageShow(
"ตรวจสอบข้อมูล"
);
36.
}
37.
finally
38.
{
39.
objConn.Close();
40.
}
41.
42.
}