public Boolean LoadAttributeMappings(FeatureMappingData theMap, IWorkspace theWS, int serial)
{
OleDbCommand theCMD;
OleDbDataReader theReader;
String theSQL = "";
int srcDT, destDT, srcL, destL, fCount;
String srcC, destC, srcF, destF, srcE, destE, constant, result;
AttributeMappingData theAMap;
try
{
theSQL = "SELECT * FROM [AttributeMappings] WHERE [SerialNumber] = " + serial.ToString();
theCMD = new OleDbCommand(theSQL, theConn);
checkOpen();
theReader = theCMD.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
while (theReader.Read())
{
srcC = theReader.GetString(1);
destC = theReader.GetString(2);
srcF = theReader.GetString(3);
destF = theReader.GetString(7);
srcDT = theReader.GetInt32(4);
destDT = theReader.GetInt32(8);
srcL = theReader.GetInt32(5);
destL = theReader.GetInt32(9);
srcE = theReader.GetString(6);
destE = theReader.GetString(10);
constant = theReader.GetString(12);
result = theReader.GetString(13);
fCount = theReader.GetInt32(11);
IField theSF = new FieldClass();
IFieldEdit theES = (IFieldEdit)theSF;
theES.Name_2 = srcF;
theES.AliasName_2 = srcF;
theES.Type_2 = ToESRIDataType(srcDT);
theES.Length_2 = srcL;
IFields destFld = GeoDbProcs.GetFeatureClassFields(theWS, destC);
int theIndex = destFld.FindField(destF);
if (theIndex >= 0)
{
IField theDF = destFld.get_Field(theIndex);
AttributeData theS = new AttributeData(srcC, theSF, fCount);
AttributeData theD = new AttributeData(destC, theDF, fCount);
theAMap = new AttributeMappingData(theMap, theS, theD);
theAMap.AddResults(result);
theAMap.constant = constant;
theMap.AddTransform(theAMap);
LoadValueMappings(theAMap);
LoadDataLoss(theAMap, serial);
}
}
return true;
}
catch (Exception ex) { return false; }
}