Private Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
pid = GridView1.DataKeys(e.RowIndex).Values(0)
Dim m = (From p In db.OrderIDs
Where p.ID = pid
Select p)
db.OrderIDs.DeleteOnSubmit(m)
db.SubmitChanges()
GridView1.EditIndex = -1
BindData()
End Sub
มัน error ตรง db.OrderIDs.DeleteOnSubmit(m) อะครับ Unable to cast object of type 'System.Data.Linq.DataQuery`1[Web1.OrderID]' to type 'Web1.OrderID'.
Tag : .NET, Web (ASP.NET), LINQ, VS 2010 (.NET 4.x)