Hi all "Solution"
I hope this helps everybody else having the same problem. ScalarQueriesTableAdapter returning 0 value from a stored procedure
Create your stored procedure with a RETURN value as normal. Then open dataset designer and drag a QueriesTableAdapter onto the design screen. Create a query and use existing stored procedure you created.
Then edit the Partial class for the named query and add the code below.
Code:
Public Function GetReturnValue(ByVal commandIndex As Integer) As Object
Return Me._commandCollection(commandIndex).Parameters(0).Value
End Function
Your
VB code will now look like this.
Code:
Dim scalarQueriesTableAdapter As DSMetricsTableAdapters.QueriesTableAdapter
scalarQueriesTableAdapter = New DSMetricsTableAdapters.QueriesTableAdapter
scalarQueriesTableAdapter.CheckMetrics("Department", "tbl_Metrics")
Dim returnValue As Integer
returnValue = scalarQueriesTableAdapter.GetReturnValue(0)
I hope this helps somebody