Public Function ExecuteNonQuery(ByVal prmSQL As String) As Boolean
connectData()
Dim addCom As New SqlCommand
Try
With addCom
.CommandType = CommandType.Text
.CommandText = prmSQL
.Connection = conn
.ExecuteNonQuery()
End With
Return True
Catch ex As Exception
Return False
End Try
End Function
Public Function ExecuteReader(ByVal prmSQL As String) As SqlDataReader
Dim dr As SqlDataReader
Dim comm As New SqlCommand
connectData()
With comm
.CommandType = CommandType.Text
.CommandText = prmSQL
.Connection = conn
dr = .ExecuteReader()
Return dr
End With
End Function
Public Function chkReplace(ByVal prmdbTable As String, ByVal prmdbQDepartMentNo As String, ByVal prmS As String) As Boolean
Dim dr As SqlDataReader
Dim s As String = "select * from " & prmdbTable & " where " & prmdbQDepartMentNo & " =" & SQ(prmS)
Try
dr = ExecuteReader(s)
dr.Read()
'-----------------------
Return dr.Item(prmdbQDepartMentNo).ToString
Return True
Catch
End Try
End Function