I have stored procedure in dbml file, I want do smth like this
Private Sub GetData()
Dim dal = New DataAccess
Dim dateList = dal.context.GetAsDateList()
Dim enumerator As IEnumerator = dateList.GetEnumerator()
While enumerator.MoveNext()
cmbDate.Items.Add(enumerator.Current)
End While
End Sub
But I have a Null reference exception. How do this in a correct way?
The GetAsDateList() Procedure is
BEGIN
SET NOCOUNT ON
SELECT DISTINCT YEAR(TRADE_DATE) AS [Year], MONTH(TRADE_DATE) AS [Month] FROM MyTable
RETURN
END