Hi Guys
I have the following code:
Public Shared Function ListLateAvailability()
Dim DBConnection As SqlConnection = New SqlConnection(GlobalParameters.DBConnection())
Dim ListLateAvailabilityTable As New DataTable
Dim SqlCommand As New SqlCommand("DSP_WLateAvailabilityProperty", DBConnection)
With SqlCommand
.CommandType = CommandType.StoredProcedure
End With
Dim DataAdapter As New SqlDataAdapter(SqlCommand)
DataAdapter.Fill(ListLateAvailabilityTable)
Return (ListLateAvailabilityTable)
'Check If Connection is Open
If (DBConnection.State = ConnectionState.Open) Then
DBConnection.Close()
End If
End Function
The query above return a recordset and outputs information.
What is the best way / practice to return the recordcount of the query that I am executing?
Kind regards
I have the following code:
Public Shared Function ListLateAvailability()
Dim DBConnection As SqlConnection = New SqlConnection(GlobalParameters.DBConnection())
Dim ListLateAvailabilityTable As New DataTable
Dim SqlCommand As New SqlCommand("DSP_WLateAvailabilityProperty", DBConnection)
With SqlCommand
.CommandType = CommandType.StoredProcedure
End With
Dim DataAdapter As New SqlDataAdapter(SqlCommand)
DataAdapter.Fill(ListLateAvailabilityTable)
Return (ListLateAvailabilityTable)
'Check If Connection is Open
If (DBConnection.State = ConnectionState.Open) Then
DBConnection.Close()
End If
End Function
The query above return a recordset and outputs information.
What is the best way / practice to return the recordcount of the query that I am executing?
Kind regards