Hi All, Any help would be greatly appreciated on this problem.
Here is my current environment:
ASP.NET 4.0
VS 2010
C#
Entity Framework
SQL 2008
Lets say I have a simple table in SQL:
CREATE TABLE [dbo].[BillingFee](
[BillingFeeID] [int] IDENTITY(1,1) NOT NULL,
[BeginDate] [datetime] NULL,
[BillFee1] [float] NULL,
[BillFee2] [float] NULL,
[BillFee3] [float] NULL,
[LastUpdate] [datetime] NOT NULL,
[LastUpdateBy] [varchar](50) NOT NULL)
ON [PRIMARY]
In my VS project, using the entity framework, I have an entity that represents the table. All update, delete & insert actions are as provided by the entity framework (no stored procs are used).
On my aspx page I have an Entity Data Source with Update enabled.
On my aspx page I have a gird view early bound to the entity data source (mentioned above). This gridview allows for updates to some of the fields.
The following fields are displayed in the grid view:
[BeginDate, BillFee1, BillFee2, BillFee3, LastUpdate, LastUpdateBy]
The following fields are updateable in the grid view:
[BillFee1, BillFee2, BillFee3]
What I would like to do:
Grab the current users credentials and time (<-- no problem) and
insert them into the LastUpdateBy and LastUpdate fields respectively whenever an update action is performed.
Result:
The SQL table is updated and my griview displays the last person and time the row was updated.
I have found a few examples that come close but I am unsure if they apply to the entity framework. Any help would be appreciated.