01.
ReadConnectSQLServer()
02.
If
txtContactID.Text.Trim() =
""
Then
03.
MessageBox.Show(
"ไม่สามารถแก้ไขรายการได้ !!!"
,
"ผลการทำงาน"
, MessageBoxButtons.OK, MessageBoxIcon.Information)
04.
ElseIf
txtRentalID.Text.Trim() =
""
Then
05.
MessageBox.Show(
"ไม่สามารถแก้ไขรายการได้ !!!"
,
"ผลการทำงาน"
, MessageBoxButtons.OK, MessageBoxIcon.Information)
06.
07.
08.
Dim
SqlEdit
As
String
09.
SqlEdit =
"UPDATE "
& tb_Name &
" SET "
& field1 &
"='"
& txtRentalID.Text &
"',"
& field12 &
"='"
& txtDesposit.Text &
"' WHERE ("
& fieldId &
"='"
& txtContactID.Text &
"')"
10.
Dim
com
As
New
SqlCommand(SqlEdit, Conn)
11.
Dim
result
As
Int16
12.
result = com.ExecuteNonQuery()
13.
If
result = 0
Then
14.
MessageBox.Show(
"ไม่สามารถแก้ไขรายการได้ !!!"
,
"ผลการทำงาน"
, MessageBoxButtons.OK, MessageBoxIcon.Information)
15.
Else
16.
MessageBox.Show(
"แก้ไขเรียบร้อยแล้ว !!!"
,
"ผลการทำงาน"
, MessageBoxButtons.OK, MessageBoxIcon.Information)
17.
End
If
18.
ShowData()
19.
End
If