************************************************************************ * CursorToCollection **************************************** FUNCTION CursorToCollection(lcCursor) LOCAL loItem, loCol as Collection loCol = CREATEOBJECT("Collection") IF EMPTY(lcCursor) lcCursor = ALIAS() ENDIF SELECT (lcCursor) SCAN SCATTER NAME loItem MEMO loCol.Add(loItem) ENDSCAN RETURN loCol ENDFUNC * CursorToCollectionand pass the resulting object to .NET. You still will have to deal with the empty dates though although I believe in this case FoxPro empty dates will default to a low value .NET date (DateTime.MinDate?).
************************************************************************ * CursorToXmlString **************************************** *** Function: A generic routine that returns an XmlAdapter XML result *** of a single table that can be loaded into a .NET *** DataSet. The table is encoded with the name of the *** alias. *** Pass: lcAlias - Optional: Name of the cursor alias to encode *** Return: Xml string ************************************************************************ FUNCTION CursorToXmlString(lcAlias) LOCAL lcXML IF EMPTY(lcAlias) lcAlias = ALIAS() ENDIF lcXML = "" LOCAL oXA as XMLAdapter oXA = CREATEOBJECT("XMLAdapter") *** lcTable doesn't exist - error here (use ALIAS() ) oXA.AddTableSchema(lcAlias,.T.,STRCONV(lcAlias,5)) oXA.ToXML("lcXML") RETURN lcXML ENDFUNC * CursorToXmlStringHope this helps,