The xpath query is too complex

Hi,

I am experimenting with Federated data and am getting the error "The xpath query is too complex".

I am trying to access an external SQL Server database. I wrote a method that I invoke in the "onGet" Server Event of the Part ItemType. Here's what the method looks like:

string szConnectionString = @"Provider=SQLOLEDB;Data Source=MYSQL\Dev; Initial Catalog=PART; User ID=innovator; Password=";

 

System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(szConnectionString);

string sqltext = "select part_nbr,cage,mfr_desc from PART.dbo.part";

 

System.Data.OleDb.OleDbCommand com = new System.Data.OleDb.OleDbCommand(sqltext);

com.Connection = myConnection;

myConnection.Open();

 

System.Data.OleDb.OleDbDataReader myDataReader = com.ExecuteReader();

 Item res5 = this.newItem("Part");

res5.setID(getNewID());

res5 = res5.apply();

while (myDataReader.Read())

{

    Item temp = this.newItem("Part");  

    temp.setProperty("part_nbr", myDataReader.GetString(0));

    temp.setProperty("cage", myDataReader.GetString(1));

    temp.setProperty("ccmfr_desc", myDataReader.GetString(2));

    res5.appendItem(temp);

};

myConnection.Close();

return res5.apply();

In my "Part" ItemType I added 3 Federated properties: part_nbr, cage, ccmfr_desc.

Can anyone shed some light here? Thanks!

Parents Reply Children
No Data