Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. ' Consultar una sentencia a la base de datos
  2. Public Function Consulta(ByVal Sentencia As String) As DataTable
  3.  
  4. Using Conexion As New SqlConnection("server=" + servidor + ";database=" + catalogo + ";uid=" + usuario + ";pwd=" + clave + ";")
  5. Using Comando As New SqlCommand(Sentencia)
  6. Using Adaptador As New SqlDataAdapter()
  7. Comando.Connection = Conexion
  8. Adaptador.SelectCommand = Comando
  9. Using Datos As New DataTable()
  10. Adaptador.Fill(Datos)
  11. Return Datos
  12. End Using
  13. End Using
  14. End Using
  15. End Using
  16.  
  17. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement