If I have the following SQL function:
How can I get the result from this SQL function.
Here is some code that I have tried, but does not work:
Code:
CREATE FUNCTION usp_GetValueTesting
(
@ID VARCHAR(10),
@Description VARCHAR(10)
)
RETURNS VARCHAR(50)
AS
BEGIN
return @ID + @Description
END
Here is some code that I have tried, but does not work:
Code:
Dim SQLStatement As String = "EXEC usp_GetValueTesting '100' 'Test'"
Dim DataSet As DataSet = DataBaseObject.ExecuteSQLStatementAndReturnDataSet(SQLStatement)
Code:
Public Function ExecuteSQLStatementAndReturnDataSet(SQLStatement As String) As DataSet 'Execute SQL statements and return a dataSet
Dim daRecords As New SqlDataAdapter(SQLStatement, DataBaseConnection)
Dim dsRecords As New DataSet("Person")
daRecords.FillSchema(dsRecords, SchemaType.Source, "Person")
daRecords.Fill(dsRecords, "Person")
Return dsRecords
End Function