01.
Dim
da
As
SqlDataAdapter
02.
Dim
ds
As
DataSet =
New
DataSet
03.
Dim
Tmpsql
As
String
=
""
04.
05.
Dim
gdvrow
As
New
DataGridViewRow
06.
07.
Dim
tmpSecId, tmpSecname, tmLastname, tmpSecadd, tmpBankId, tmpBankNumber, tmpBankName, tmpBankMajor
As
String
08.
09.
Tmpsql =
" SELECT Supplier.Sup_ID, Supplier.Sup_Name, Supplier.Sup_lastname, Supplier.Sup_Address, Supplier.Bank_ID, Bank.Bank_AccountNumber, Bank.Bank_Name, Bank.Bank_Major"
10.
Tmpsql &=
" FROM Supplier INNER JOIN Bank ON Supplier.Bank_ID = Bank.Bank_ID"
11.
Tmpsql &=
" WHERE (((Supplier.Sup_Name)Like '"
& Tmplist &
"'));"
12.
13.
If
IsFind =
True
Then
14.
ds.Tables(
"SUPPLIER"
).Clear()
15.
16.
End
If
17.
18.
da =
New
SqlDataAdapter(Tmpsql, Cn)
19.
da.Fill(ds,
"SUPPLIER"
)
20.
21.
If
ds.Tables(
"SUPPLIER"
).Rows.Count <> 0
Then
22.
IsFind =
True
23.
For
i
As
Integer
= 0
To
ds.Tables(
"SUPPLIER"
).Rows.Count - 1
24.
With
gdvrow
25.
tmpSecId = ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"SUP_ID"
).ToString.Trim
26.
tmpSecname = ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"SUP_NAME"
).ToString.Trim
27.
tmLastname = ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"SUP_LASTNAME"
).ToString.Trim
28.
tmpSecadd = ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"SUP_ADDRESS"
).ToString.Trim
29.
tmpBankId = ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"Bank_ID"
).ToString.Trim
30.
tmpBankNumber =
If
(IsDBNull(ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"Bank_AccountNumber"
)),
""
, Trim(ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"Bank_AccountNumber"
)))
31.
tmpBankName =
If
(IsDBNull(ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"Bank_Name"
)),
""
, Trim(ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"Bank_Name"
)))
32.
tmpBankMajor =
If
(IsDBNull(ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"Bank_Major"
)),
""
, Trim(ds.Tables(
"SUPPLIER"
).Rows(i).Item(
"Bank_Major"
)))
33.
34.
35.
36.
Dim
sDataRow
As
String
() = {tmpSecId, tmpSecname, tmLastname, tmpSecadd, tmpBankId, tmpBankNumber, tmpBankName, tmpBankMajor}
37.
38.
DGV1.Rows.Add(sDataRow)
39.
DGV1.
ReadOnly
=
True
40.
End
With