I am trying to insert data into a feature class field called "DACOUNCIL". You can see the code below.
workspaceEdit = aoDataset.Workspace as ESRI.ArcGIS.Geodatabase.IWorkspaceEdit;
if (!(workspaceEdit.IsBeingEdited()))
{
workspaceEdit.StartEditing(false);
adfSelectedParcelGeometry = SelectedParcelsGraphicsLayer.GeometryFromRow(SelectedParcelsGraphicsLayer.Rows[0]);
aoSelectedParcelGeometry = ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToIGeometry(adfSelectedParcelGeometry, serverContext);
// Create a feature and set its geometry and attributes
ESRI.ArcGIS.Geodatabase.IFeature feature;
feature = featureClass.CreateFeature();
feature.Shape = aoSelectedParcelGeometry;
//THIS WORKS
Double dblAreaFeet = (Double)SelectedParcelsGraphicsLayer.Rows[0]["AREA_FEET"];
feature.set_Value(featureClass.FindField("AREA_FEET"), dblAreaFeet);
//THIS DOES NOT WORK
Double dbldaCouncil = (Double)SelectedParcelsGraphicsLayer.Rows[0]["DACOUNCIL"];
feature.set_Value(featureClass.FindField("COUNCIL_DISTRICT"), dbldaCouncil);
//THIS DOES NOT WORK
//feature.set_Value(featureClass.FindField("DACOUNCIL"), (Double)14.0);
feature.set_Value(featureClass.FindField("DEMOLITION_ID"), "11");
string strNotes = "shawn " + DateTime.Now;
feature.set_Value(featureClass.FindField("NOTES"), strNotes);
// Commit the new feature to the database
feature.Store();
workspaceEdit.StopEditing(true);
// Release the current server context
serverContext.ReleaseContext();
}
}
It works find on most data. It has a problem with a field that in SQL Server 2005 is listed as being Numeric - precision 10; scale 0. Some how I think the scale 0 is causing problems.1) I can insert in other fields that are double - see area feet above.2) The exception error is always thrown on the .store operation. 3) Checking the DACOUNCIL data type using IFields as below it returns esriFieldTypeDouble.4) ArcCatalog lists the data type as being Double5) I can edit the field in ArcMap6) I can edit the field in SQL ServerESRI.ArcGIS.Geodatabase.IFields fields = featureClass.Fields;
string strFieldType = fields.get_Field(i).Type.ToString();
Here is the error message I get:{"Underlying DBMS error[Microsoft SQL Native Client: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.][gisVector.GISLOADER.CCS_DemolitionParcels]"}