I have an xsd with a DataRow that has a field of type NetSdoGeometry.sdogeometry. When I attempt to get the data, I can retrive all the fields from the table except for one. I get an error for the geometry field and no data. The geometry DOES have data but somehow it thinks that it is null:
GEOMETRY = 'r.GEOMETRY' threw an exception of type 'System.Data.StrongTypingException'
Here is the call to get the data:
MyDS.GisRow r = mDS.Gis.FindByGis_ID((decimal)aRow.Cells["Gis_ID"].Value);
Here are the properties for the GEOMETRY DataColumn:
AllowDBNull = True
AutoIncrement = False
AutoIncrementSeed = 0
AutoIncrementStep = 1
Caption = GEOMETRY
DataType = NetSdoGeometry.sdogeometry
DateTimeMode = UnspecifiedLocal
DefaultValue =
Expression =
MaxLength = -1
NullValue = (Throw exception)
ReadOnly = False
Source = GEOMETRY
Unique = False
Name = GEOMETRY
Here is the MyDS.Designer.cs for the dataset/geometry field:
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
public NetSdoGeometry.sdogeometry GEOMETRY {
get {
try {
return ((global::NetSdoGeometry.sdogeometry)(this[this.tableGis.GEOMETRYColumn]));
}
catch (global::System.InvalidCastException e) {
throw new global::System.Data.StrongTypingException("The value for column \'GEOMETRY\' in table \'Gis\' is DBNull.", e);
}
}
set {
this[this.tableGis.GEOMETRYColumn] = value;
}
}
There is data for the GEOMETRY field in the table for that record. Why is the GEOMETRY field coming back null and generating the StrongTypingException error for that field?
Thanks Before Hand