AX 2009 - Want to fetch an Image field from AX table on insert into C# DataTable

I’m new to AX. I have an AX table with some string fields that I want to dump into my C# DataTable. This works fine. Now I want to do the same with an Image field defined in the AX table. But I don’t know how to cast this properly. Here is some code I am trying to use:


dt = new DataTable();

dt.Columns.Add(new DataColumn(“FileType”, typeof(string)));
dt.Columns.Add(new DataColumn(“File_”, typeof(Image)));

using (axRecord = ax.CreateAxaptaRecord(“DocuValue”))
string strSQLName = "SELECT * FROM %1;


while (axRecord.Found)
DataRow dr = dt.NewRow();
dr[“FileType”] = Convert.ToString(axRecord4.get_Field(“FileType”));
dr[“File_”] = axRecord4.get_Field(“File_”);


In AX table DocuValue, column File_ is defined as Image. I tried various casting techniques on line:

dr[“File_”] = axRecord4.get_Field(“File_”);

But I always get this error:

The supplied method arguments are not valid.

Like I said earlier, I can load the string field into my C# DataTable with no problem. It’s the Image column I cannot do. How can I do this?