Click here to Skip to main content
15,888,908 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionUpdate data in Report View control on a form Pin
Member 1129477510-Aug-15 11:27
Member 1129477510-Aug-15 11:27 
AnswerRe: Update data in Report View control on a form Pin
Richard Deeming11-Aug-15 4:25
mveRichard Deeming11-Aug-15 4:25 
GeneralRe: Update data in Report View control on a form Pin
Member 1129477511-Aug-15 4:49
Member 1129477511-Aug-15 4:49 
QuestionEntity Framework : Get original Values for each object's property Pin
satc10-Aug-15 3:42
satc10-Aug-15 3:42 
AnswerRe: Entity Framework : Get original Values for each object's property Pin
Eddy Vluggen10-Aug-15 5:29
professionalEddy Vluggen10-Aug-15 5:29 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
satc10-Aug-15 5:47
satc10-Aug-15 5:47 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Eddy Vluggen10-Aug-15 5:53
professionalEddy Vluggen10-Aug-15 5:53 
AnswerRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 5:38
mveRichard Deeming10-Aug-15 5:38 
You're looking for the DbContext.Entry method[^]:
VB.NET
Dim entry As DbEnttiyEntry(Of YourEntityType) = yourContext.Entry(yourEntity)

' All properties:
Dim currentValues As DbPropertyValues = entry.CurrentValues
Dim originalValues As DbPropertyValues = entry.OriginalValues
Dim databaseValues As DbPropertyValues = entry.GetDatabaseValues()

For Each propertyName As String In currentValues.PropertyNames
    Dim current As Object = currentValues(propertyName)
    Dim original As Object = originalValues(propertyName)
    Dim database As Object = databaseValues(propertyName)
Next


' Single property:
Dim prop As DbPropertyEntry = entry.Property("PropertyName")
Dim current As Object = prop.CurrentValue
Dim original As Object = prop.OriginalValue


' Single property (strongly typed):
Dim prop As DbPropertyEntry(Of YourEntityType, PropertyType) = entry.Property(Function(x) x.PropertyName)
Dim current As PropertyType = prop.CurrentValue
Dim original As PropertyType = prop.OriginalValue




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Entity Framework : Get original Values for each object's property Pin
satc10-Aug-15 5:47
satc10-Aug-15 5:47 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 5:54
mveRichard Deeming10-Aug-15 5:54 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Eddy Vluggen10-Aug-15 5:51
professionalEddy Vluggen10-Aug-15 5:51 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 5:56
mveRichard Deeming10-Aug-15 5:56 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
satc10-Aug-15 6:10
satc10-Aug-15 6:10 
GeneralRe: Entity Framework : Get original Values for each object's property Pin
Richard Deeming10-Aug-15 6:17
mveRichard Deeming10-Aug-15 6:17 
Questionvb coding Pin
Member 118868934-Aug-15 21:48
Member 118868934-Aug-15 21:48 
AnswerRe: vb coding Pin
Richard MacCutchan4-Aug-15 22:21
mveRichard MacCutchan4-Aug-15 22:21 
QuestionSQL Linq, Sum of multiple columns Pin
jkirkerx4-Aug-15 7:23
professionaljkirkerx4-Aug-15 7:23 
AnswerRe: SQL Linq, Sum of multiple columns Pin
jkirkerx4-Aug-15 8:20
professionaljkirkerx4-Aug-15 8:20 
Questionsql server 2008 how to pivot Login and logOut Pin
Member 118832203-Aug-15 14:26
Member 118832203-Aug-15 14:26 
AnswerRe: sql server 2008 how to pivot Login and logOut Pin
Mycroft Holmes3-Aug-15 14:38
professionalMycroft Holmes3-Aug-15 14:38 
GeneralRe: sql server 2008 how to pivot Login and logOut Pin
Member 118832203-Aug-15 15:05
Member 118832203-Aug-15 15:05 
GeneralRe: sql server 2008 how to pivot Login and logOut Pin
Richard MacCutchan3-Aug-15 21:08
mveRichard MacCutchan3-Aug-15 21:08 
QuestionRe: sql server 2008 how to pivot Login and logOut Pin
Eddy Vluggen3-Aug-15 21:29
professionalEddy Vluggen3-Aug-15 21:29 
QuestionSQL Linq, Bulk Transfer substitute Pin
jkirkerx3-Aug-15 8:02
professionaljkirkerx3-Aug-15 8:02 
Answer[solved] Pin
jkirkerx3-Aug-15 9:02
professionaljkirkerx3-Aug-15 9:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.