RE: Need ideas about comparing old and new values
From: Charles (anonymous_at_discussions.microsoft.com)
Date: 03/24/04
- Next message: Seth Broomer: "DataGrid- Adding a new row in the middle of the datagrid"
- Previous message: Kevin Spencer: "Re: How do I CAST a control?"
- In reply to: Charles: "Need ideas about comparing old and new values"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 12:01:15 -0800
Well, this is what I am getting so far. Any input would be helpful. Thanks.
Private Function TestCompare(ByVal org As Object, ByVal [new] As Object) As DataTable
Dim sOrg As String
Dim sNew As String
Dim fis As PropertyInfo() = org.GetType.GetProperties
For Each fi As PropertyInfo In fis
sOrg = org.GetType.InvokeMember(fi.Name.ToString(), BindingFlags.GetProperty, Nothing, org, Nothing)
sNew = [new].GetType.InvokeMember(fi.Name.ToString(), BindingFlags.GetProperty, Nothing, [new], Nothing)
If sOrg <> sNew Then
Debug.WriteLine(sOrg & " " & sNew & " " & fi.Name.ToString)
End If
Next
End Function
----- Charles wrote: -----
I have a webform that would display an employee's contact information (address, phone, and etc). This data comes from a class (CEmployee) that accesses a database. The employee can change their address on this form.
I would like to get some (good) ideas on how I could tell what information has been changed. For example, they change their street address. I want to make something that would tell me that someone changed their address. If I can I would like to have it return a datatable for other processing (store the change in the database).
Thanks for any ideas!
Charles
- Next message: Seth Broomer: "DataGrid- Adding a new row in the middle of the datagrid"
- Previous message: Kevin Spencer: "Re: How do I CAST a control?"
- In reply to: Charles: "Need ideas about comparing old and new values"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|