Hi,
I am creating a module based on the Guest Book tutorial by Michael Washington. Everything works except the 'delete' from the gridview. The gridview is connected to an objectDataProvider with the business controler set to the ToDoController.vb and all procedures have been added to the setup. I have the gridview on the edit module page. I debugged it and see that the ItemID field (PrimaryKey, Item Identity) is not being passed from the gridview to the controller, it is always 0. Below is the code:
Controller.vb
<DataObjectMethod(DataObjectMethodType.Delete)> _
Public Shared Sub ToDo_Delete(ByVal objTest As ToDoInfo)
DataProvider.Instance.Creations_ToDo_Delete(objTest.ItemID)
End Sub
DataProvider.vb
Public MustOverride Sub Creations_ToDo_Delete(ByVal ItemID As Integer)
SQLProvider.vb
Public Overrides Sub Creations_ToDo_Delete(ByVal ItemID As Integer)
SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("Creations_ToDo_Delete"), ItemID)
End Sub
Info.vb
Public Property ItemID() As Integer
Get
Return _ItemID
End Get
Set(ByVal Value As Integer)
_ItemID = Value
End Set
End Property
Stored Procedure:
dbo.[Creations_Creations_ToDo_Delete]
(
@ItemID int
)
AS
DELETE FROM Creations_ToDo
WHERE (ItemID = @ItemID)
RETURN
Any help would be appreciated.
Dan5150