You are right, by default DateField has a default length of 36.
You can try the following feature service that has a nullable DateField. Setting the attribute value to null does not raise any exception. You can wire up to EndSaveEdits and SaveEditsFailed to see that this new value is actually saved.
FeatureLayer layer = new FeatureLayer() { Url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0", OutFields = new ESRI.ArcGIS.Client.Tasks.OutFields() { "*" } };
layer.Initialized += (s,e) =>
{
layer.Update();
};
layer.UpdateCompleted += (s,e) =>
{
var graphic = layer.Graphics.FirstOrDefault(g => (int)g.Attributes["objectid"] == 105635);
graphic.Attributes["collection_time"] = null;
};
layer.Initialize();
If you are still experiencing issues please explain your use case with details about the data and application workflow so we can reproduce it here. Thanks.
I tried the easiest way to populate the field but still get a NullReferenceException error.
ESRI.ArcGIS.Client.FeatureLayer fl = theMap.Layers["flyr_RoadClosureLocations"] as ESRI.ArcGIS.Client.FeatureLayer;
foreach (ESRI.ArcGIS.Client.Graphic g in fl.Graphics)
{
if (g.Attributes["UPID"].ToString() == "CAB_035")
{
MessageBox.Show(g.Attributes["UPDATEDATE"].ToString());
g.Attributes["UPDATEDATE"] = null;
}
}
I uploaded three screenshots to show the settings of the feature class, the layer and the feature service. In the Silverlight App, I tried both 2.1 and 2.2 API but get the same error.Environment: ArcSDE 10 Sp1ArcGIS Server 10 Sp1