01.
Private
Sub
Button1_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
02.
Dim
connect2
As
New
SqlConnection(sql_db)
03.
Dim
cmdsql2
As
New
SqlCommand
04.
Dim
rdr1
As
SqlDataReader
05.
cmdsql2.Connection = connect2
06.
cmdsql2.CommandText =
"select [ID],[landid],[coorx],[coory],[canetype],[area] from map_plot where landid like '%251995%' "
07.
cmdsql2.CommandType = CommandType.Text
08.
09.
Try
10.
connect2.Open()
11.
rdr1 = cmdsql2.ExecuteReader()
12.
While
rdr1.Read()
13.
lst.Add(
New
KeyValuePair(Of
String
,
String
)(rdr1(
"landid"
), rdr1(
"canetype"
)))
14.
add_str_list(rdr1(
"coorx"
), rdr1(
"coory"
))
15.
End
While
16.
Repeater1.DataSource = lst
17.
Repeater1.DataBind()
18.
Catch
ex
As
Exception
19.
connect2.Close()
20.
connect2.Dispose()
21.
End
Try
22.
End
Sub
23.
Function
add_str_list(
ByVal
a
As
String
,
ByVal
b
As
String
)
As
String
24.
Dim
strArr(), str2Arr()
As
String
25.
strArr = a.Split(
","
)
26.
str2Arr = b.Split(
","
)
27.
For
i
As
Integer
= 0
To
strArr.Length - 1
28.
lst.Add(
New
KeyValuePair(Of
String
,
String
)(strArr(i),
","
& str2Arr(i)))
29.
Next
30.
Return
0
31.
End
Function