کسی می تونه در مورد delegate ها توضیح بده؟
البته با مثال!
Printable View
کسی می تونه در مورد delegate ها توضیح بده؟
البته با مثال!
Delegate
این مثال یک نمونه است که من در برنامه ام ازش استفاده کردم البته اون رو تو module گذاشتم:
Private Shared Sub OnRowUpdated(ByVal sender As Object, ByVal args As SqlRowUpdatedEventArgs)
' Include a variable and a command to retrieve the identity value from the database.
Dim newID As Integer = 0
Dim idCMD As SqlCommand = New SqlCommand("SELECT @@IDENTITY", cnDatabase)
If args.StatementType = StatementType.Insert Then
newID = CInt(idCMD.ExecuteScalar())
args.Row(0) = newID
End If
End Sub