Book a Demo

Author Topic: API for reference data problem  (Read 2989 times)

cty

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
API for reference data problem
« on: December 22, 2009, 07:57:33 pm »
Hi all,

I am trying to implement with C# an automatic load of reference data files.
After a deep seek in these forums items, I found an old post that explains how to use the undocumented CustomCommand method of Repository.

I have tried the two options :

Code: [Select]
StreamReader sr = f.OpenText();
repository.CustomCommand("Repository", "ImportRefData", sr.ToString());

or

Code: [Select]
repository.CustomCommand("Repository", "ImportRefData", fileName);
Both returns the same error :
Code: [Select]
Error:
Code = 0x00ce556
Source = Line : 1; Char : 1
Error Description : invalid at the top level of the document

The XML file seems not to be parsed correctly  ... but this file is correct (I can import it throught the Import Reference Data menu).

Any idea ???

Ronan

cty

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: API for reference data problem
« Reply #1 on: December 22, 2009, 08:12:34 pm »
Quote
Hi all,

I am trying to implement with C# an automatic load of reference data files.
After a deep seek in these forums items, I found an old post that explains how to use the undocumented CustomCommand method of Repository.

I have tried the two options :

Code: [Select]
StreamReader sr = f.OpenText();
repository.CustomCommand("Repository", "ImportRefData", sr.ToString());

or

Code: [Select]
repository.CustomCommand("Repository", "ImportRefData", fileName);
Both returns the same error :
Code: [Select]
Error:
Code = 0x00ce556
Source = Line : 1; Char : 1
Error Description : invalid at the top level of the document

The XML file seems not to be parsed correctly  ... but this file is correct (I can import it throught the Import Reference Data menu).

Any idea ???

Ronan

Wait ! Wait ! Shame on me  :-/
Please forget the sr.toString(), and replace it with sr.ReadToEnd().

Anyway I still have an error :
Code: [Select]
DAO.Recordset [3022]
The changes your requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship

I strongly apologize for this newbie error.