PDA

View Full Version : کسی می تونه در مورد delegate ها توضیح بده؟



linux
پنج شنبه 28 آبان 1383, 00:02 صبح
کسی می تونه در مورد delegate ها توضیح بده؟
البته با مثال!

sh
جمعه 29 آبان 1383, 10:15 صبح
Delegate

mahdie
دوشنبه 23 آذر 1383, 08:25 صبح
این مثال یک نمونه است که من در برنامه ام ازش استفاده کردم البته اون رو تو 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