Dim conn As New SqlConnection
Dim cmd As New SqlCommand()
Dim c As String
conn.ConnectionString = "Data Source=chat-PC;Initial Catalog=Shop;User ID=sa;Password=1234"
cmd.CommandText = "SELECT COUNT(Room_id), COUNT(Services_equipment) from Services where Room_id= '" & txtidroom.Text & "' and Services_equipment = '" & txtidse.Text & "' "
cmd.Connection = conn
cmd.Connection.Open()
c = cmd.ExecuteScalar
End If
If c > 0 Then
MessageBox.Show("รหัสห้องพักนี้ได้แจ้งการซ่อมประเภทนี้แล้ว", "ข้อผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If