Dim ds As DataSet = get_dataset()
Public Function get_dataset() As DataSet
Dim con As New SqlConnection(conex)
Dim adapter As SqlDataAdapter = Nothing
Dim ds As New DataSet()
Dim query As String = "query sql"
con.Open()
Using cmd As New SqlCommand(query, con)
cmd.Parameters.Add("@parametro1", SqlDbType.VarChar).Value = ""
cmd.Parameters.Add("@parametro2", SqlDbType.VarChar).Value = ""
adapter = New SqlDataAdapter(cmd)
adapter.Fill(ds)
End Using
con.Close()
Return ds
End Function
No hay comentarios.:
Publicar un comentario