In my VB.net code i have:
cmd.CommandText = "SELECT * FROM [strfg].[dbo].[Myfunc] (@MyParam)"
Dim myparam As New SqlParameter("@MyParam", a)
cmd.Parameters.Add(myparam)
The function (runnig on SQL server) returns a table with four columns, one row.
How do I call this function from Visual Basic? cmd.ExecuteScalar() is obviously not correct. In c++ I use a recordset. What is the equivalent in vb? Does anyone have a short example?
You want to do something like this:
Where you use the index value based on the order of the returned fields, and its type in the Get.