S
shapper
Hello,
I am creating a ListView with an ObjectDataSource and Linq. However I
am getting an error:
ObjectDataSource 'odsTags' could not find a non-generic method
'GetTags' that has no parameters.
The GetTags function is there! Here is my code:
Private Sub lvTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles lvTags.Init
With lvTags
.DataKeyNames = New String() {"TagID"}
.DataSourceID = "odsTags"
.ID = "lvTags"
.InsertItemPosition = InsertItemPosition.FirstItem
.EditItemTemplate = New
TagsTemplate(TemplateType.EditItemTemplate)
.InsertItemTemplate = New
TagsTemplate(TemplateType.InsertItemTemplate)
.ItemTemplate = New TagsTemplate(TemplateType.ItemTemplate)
.LayoutTemplate = New
TagsTemplate(TemplateType.LayoutTemplate)
End With
End Sub
Private Sub odsTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles odsTags.Init
With odsTags
.ID = "odsTags"
.SelectMethod = "GetTags"
.TypeName = "Tag"
End With
End Sub
Public Shared Function GetTags() As ICollection
Dim database As New CodeDataContext
Dim tags = From t In database.Tags _
Select t.TagID, _
t.Text, _
Active = t.FilesTags.Any Or
t.ArticlesTags.Any
Return tags
End Function
What am I doing wrong?
I suspect it might be because of
..TypeName = "Tag"
But if I don't use this I get the following error:
A type must be specified in the TypeName property of ObjectDataSource
'odsTags'.
Thank You,
Miguel
I am creating a ListView with an ObjectDataSource and Linq. However I
am getting an error:
ObjectDataSource 'odsTags' could not find a non-generic method
'GetTags' that has no parameters.
The GetTags function is there! Here is my code:
Private Sub lvTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles lvTags.Init
With lvTags
.DataKeyNames = New String() {"TagID"}
.DataSourceID = "odsTags"
.ID = "lvTags"
.InsertItemPosition = InsertItemPosition.FirstItem
.EditItemTemplate = New
TagsTemplate(TemplateType.EditItemTemplate)
.InsertItemTemplate = New
TagsTemplate(TemplateType.InsertItemTemplate)
.ItemTemplate = New TagsTemplate(TemplateType.ItemTemplate)
.LayoutTemplate = New
TagsTemplate(TemplateType.LayoutTemplate)
End With
End Sub
Private Sub odsTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles odsTags.Init
With odsTags
.ID = "odsTags"
.SelectMethod = "GetTags"
.TypeName = "Tag"
End With
End Sub
Public Shared Function GetTags() As ICollection
Dim database As New CodeDataContext
Dim tags = From t In database.Tags _
Select t.TagID, _
t.Text, _
Active = t.FilesTags.Any Or
t.ArticlesTags.Any
Return tags
End Function
What am I doing wrong?
I suspect it might be because of
..TypeName = "Tag"
But if I don't use this I get the following error:
A type must be specified in the TypeName property of ObjectDataSource
'odsTags'.
Thank You,
Miguel