I need two answers... how to do this with a function that calls a stored procedure and how to do it with a function that calls an ad hoc query.
I have created a linq to sql class which uses my sMenu table and a stored procedure.
I now am creating a class which will use the stored procedure and create ad hoc queries.
In my second class, I tried this, but really don't know what I'm doing.
Public Shared Function [Select]() As IEnumerable(Of sMenu)
Dim db As New sMenuDataContext
the s_getallmenus is a stored procedure, but it says that it is returning an integer, not an ienumerable... truthfully, I don't know what to return or what I'm doing. How would I do a function to return a recordset to be used by a combobox?
the sp is this:
ALTER PROCEDURE dbo.s_GetAllMenus
SET NOCOUNT ON;
Order by MenuName
then with my combobx, I'm using:
Dim db As New Linq.sMenuDataContext
.Items.Add(New RadComboBoxItem("Main", "0"))
.DataSource = db.s_GetAllMenus
.DataTextField = "MenuName"
.DataValueField = "MenuId"
Now, in the above, I have tried to do this with a stored procedure, poorly.
How also do I create an ad hoc query in my function class and then how do I apply that to my combobox?