vendredi 8 mai 2015

Changing boolean values from VB.NET

I have a function on VB.NET that deletes the selected record, I would like to change it so instead it updates a boolean field from false to true

This is the actual code block:

<System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, True)> _
Public Function BLL_tblClient_DeleteByPK_ClientID(ByVal ClientID As Integer) As Boolean

Dim rowsAffected As Integer = Adapter.Delete(ClientID)

Return rowsAffected = 1

End Function

Field on the table is Inactive so a simple sql way of doing this would be UPDATE tblClients SET Inactive = 1 WHERE ClientID = ClientID but how can I accomplish that from VB.NET?

Aucun commentaire:

Enregistrer un commentaire