Take a look at this, and see if it helps:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2432732&SiteID=1
David Wierhttp://aspnet101.comhttp://iWritePro.com- One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
Hi,
I follow your hint and solved that error and now I have a new one when
I delete a row:
" Exception Details: System.Data.Linq.ChangeConflictException: Row not
found or changed."
Any idea why do I get this error?
Private Sub ldsTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles ldsTags.Init
With ldsTags
.ContextTypeName = "MyDbDataContext"
.EnableDelete = True
.EnableInsert = True
.EnableUpdate = True
.ID = "ldsTags"
.TableName = "Tags"
End With
End Sub ' ldsTags_Init
Private Sub ldsTags_Deleting(ByVal sender As Object, ByVal e As
LinqDataSourceDeleteEventArgs) Handles ldsTags.Deleting
Dim tag As Tag = CType(e.OriginalObject, Tag)
Dim database As New MyDbDataContext
database.Tags.Attach(tag)
database.Tags.DeleteOnSubmit(tag)
database.SubmitChanges()
End Sub ' ldsTags_Deleting
Private Sub ldsTags_Selecting(ByVal sender As Object, ByVal e As
LinqDataSourceSelectEventArgs) Handles ldsTags.Selecting
Dim database As New MyDbDataContext
Dim tags = From t In database.Tags _
Select t.TagID, _
t.Text, _
Active = t.FilesTags.Any Or t.ArticlesTags.Any
e.Result = tags
End Sub ' ldsTags_Selecting
' lvTags_Init
Private Sub lvTags_Init(ByVal sender As Object, ByVal e As
EventArgs) Handles lvTags.Init
With lvTags
.DataSourceID = "ldsTags"
.DataKeyNames = New String() {"TagID"}
.ID = "lvTags"
.InsertItemPosition = InsertItemPosition.FirstItem
End With
With lvTags
.EditItemTemplate = New
TagsTemplate(TemplateType.EditItemTemplate)
.EmptyDataTemplate = New
TagsTemplate(TemplateType.EmptyDataTemplate)
.InsertItemTemplate = New
TagsTemplate(TemplateType.InsertItemTemplate)
.ItemTemplate = New TagsTemplate(TemplateType.ItemTemplate)
.LayoutTemplate = New
TagsTemplate(TemplateType.LayoutTemplate)
End With
End Sub ' lvTags_Init
Private Sub lvTags_Load(ByVal sender As Object, ByVal e As
EventArgs) Handles lvTags.Load
lvTags.DataBind()
End Sub ' lvTags_Load
Thanks,
Miguel