01.
Imports
System.Data
02.
Imports
System.Data.SqlClient
03.
Public
Class
Form2
04.
Dim
Conn
As
SqlConnection =
New
SqlConnection
05.
Dim
da
As
SqlDataAdapter
06.
Dim
dt
As
New
DataTable
07.
Private
bin
As
New
BindingSource
08.
Dim
CurrentRecord
As
Integer
09.
10.
11.
Private
Sub
Form2_Load(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
MyBase
.Load
12.
Dim
strConn
As
String
13.
strConn =
"Data Source=.\SQLEXPRESS;Initial Catalog=SSPEGIS;Integrated Security=True"
14.
Conn =
New
SqlConnection(strConn)
15.
16.
Dim
sqlland
As
String
=
""
17.
sqlland =
"SELECT * FROM land ORDER BY LANDID"
18.
19.
da =
New
SqlDataAdapter(sqlland, Conn)
20.
da.Fill(dt)
21.
22.
Dim
cmb
As
SqlCommandBuilder
23.
cmb =
New
SqlCommandBuilder(da)
24.
bin.DataSource = dt
25.
26.
27.
28.
29.
Try
30.
31.
If
Convert.ToString(dt.Rows(CurrentRecord).Item(
"PICTURE"
)) <>
""
Then
32.
33.
PictureBox1.Image = Image.FromFile(Convert.ToString(dt.Rows(CurrentRecord).Item(
"PICTURE"
)))
34.
Else
35.
36.
PictureBox1.Image =
Nothing
37.
38.
39.
End
If
40.
Catch
41.
42.
PictureBox1.Image =
Nothing
43.
44.
End
Try
45.
End
Sub
46.
47.
Private
Sub
btnNext_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
48.
bin.Position += 1
49.
If
bin.Current(
"PICTURE"
)
Then
50.
End
If
51.
End
Sub
52.
End
Class