รายละเอียดของการตอบ ::
... ใส่ความคิดเห็นตรงนี้.......
 If txtstatus.Text = "บันทึกข้อมูล" Then
                DialogResult = MessageBox.Show("คุณต้องการบันทึกข้อมูลหรือไม่ ?", "บันทึกข้อมูล", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
            End If
            If txtstatus.Text = "อัพเดท" Then
                DialogResult = MessageBox.Show("คุณต้องการแก้ไขข้อมูลหรือไม่ ?", "แก้ไขข้อมูล", MessageBoxButtons.YesNo, MessageBoxIcon.Information)
            End If
            If DialogResult.ToString() = "Yes" Then
                If txtstatus.Text = "บันทึกข้อมูล" Then
                    sql = "Select id_head,name_head from tbheadpaper Where id_head = '" & txtid_head.Text & "'"
                    da = New SqlDataAdapter(sql, conn)
                    dt = New DataTable
                    da.Fill(dt)
                    If dt.Rows.Count > 0 Then
                        iUse = True
                        MessageBox.Show("มีข้อมูลอยู่แล้ว / ทำการตรวจสอบข้อมูล")
                        Return
                    End If
                    Dim sqlinsert As String = "insert into tbheadpaper (id_head,name_head) values ('" & txtid_head.Text & "','" & txthead.Text & "')"
                    Dim com As SqlCommand = New SqlCommand()
                    com.CommandText = sqlinsert
                    com.CommandType = CommandType.Text
                    com.Connection = conn
                    com.ExecuteNonQuery()
                    'conn.Close()
                    MessageBox.Show("บันทึกข้อมูลเรียบร้อย")
                    txtstatus.Text = "บันทึกข้อมูล"
                    txtid_head.Focus()
                    Clear()
                    DetailedData()