Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling date fields from Visual FoxPro
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01129644
Message ID:
01171269
Views:
8
Ted,

>this.oSurveyDue.Entity.Svd_PostDT = null;
>// Is this how I should be doing the assignment after you showed me how to SetDataRow() yesterday? (Because my updates still affect the first row)
>
>// Get the DataRow
>DataRow CurrentRow = dsSurveyDue.Tables[this.oSurveyDue.TableName].Rows[e.RowIndex];
>
>// Use the below to set the entity data row
>this.oSurveyDue.Entity.SetDataRow(CurrentRow);


The RowUpdating event does pass the current row in the e.RowIndex property, so your code is correct for getting a reference to the DataRow being updated.


>I changed the entity set/get:
>
>public DateTime? Svd_PostDT
>{
>get { return (DateTime?)mmType.GetNullableDbValue(this.Row["Svd_PostDT"]); }
>set { this.Row["Svd_PostDT"] = (value == null) ? mmType.GetEmptyDataValue("System.DateTime") : value; }
> // 11/16/2006 TAG added GetEmptyDataValue() above
>}

That will work if you want to store an empty date value rather than null...if you want to save a null instead, you should do this:
set { this.Row["svd_PostDT"] = (value == null) ? DBNull.Value : value; }
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform