Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim vcStr As String = "Server=SERVERSQLEXPRESS;DataBase=GENERAL;User Id=sa;Password=12345;"
- Private Function Conectar(oCN As SqlConnection, vcStr As String) As Boolean
- Try
- If oCN.State = ConnectionState.Closed Then
- oCN.ConnectionString = vcStr
- oCN.Open()
- End If
- Catch ex As Exception
- Return False
- End Try
- Return True
- End Function
- Public Function Find(iCodCF As Integer, iSequencia As Integer) As Boolean
- Dim vlOK As Boolean = False
- Dim oCN As New SqlConnection
- If Conectar(oCN, vcStr) = True Then
- Dim oCD As New SqlCommand
- oCD.Connection = oCN
- Dim vcQ As String = "SELECT * FROM Telefone" &
- " WHERE i_codcf = " & iCodCF &
- " AND i_sequencia = " & iSequencia
- oCD.CommandText = vcQ
- Dim oDR As SqlDataReader = oCD.ExecuteReader()
- If oDR.Read() Then
- ...
- ...
- ...
- vlOK = True
- Else
- ...
- vlOK = False
- End If
- oDR.Close()
- oCN.Close()
- End If
- Return vlOK
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement