I would like to obtain a range of data in the visual basic function, that is to say I have 1000 data but I only want to obtain the amount of 100 data, this is my code in Visual Basic and I would like to know how to obtain the amount of data, in this way I get all the data that I have stored in sql but I would like to only get a certain amount
Public Function Datos(ByVal NoFact As String) As DataTable
Try
Dim dtResultado As New DataTable
Dim sqladap As New SqlClient.SqlDataAdapter()
If Todas = True Then
Dim sqlcon As New SqlClient.SqlCommand("SP_Example")
sqlcon.CommandType = CommandType.StoredProcedure
sqlcon.Connection = con
con.Open()
sqladap.SelectCommand = sqlcon
sqladap.Fill(dtResultado)
If dtResultado.Rows.Count > 0 Then
Return dtResultado
Else
Return New DataTable
End If