<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Federation Data</title><link>https://www.aras.com/community/f/development/3135/federation-data</link><description>I&amp;#39;m trying to duplicate the code from an article that was posted in &amp;quot;Knowledge Base&amp;quot; called &amp;quot;Further Example of Federation&amp;quot;. After following the instructions and changing&amp;#160;the connection to my database I get a &amp;quot; [object Object]&amp;quot; error. Below is my method</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Federation Data</title><link>https://www.aras.com/community/thread/125?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2017 15:32:22 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:e779ddda-a007-4b2e-ac3a-afe8dd3174b2</guid><dc:creator>Eli Donahue</dc:creator><description>Hi didonato,

One way to test your database connection is to set up a static sample with a known result, run the sample with the &lt;strong&gt;Run Server Event&lt;/strong&gt; in the Aras Method Editor, and then confirm that the connection results match your expected result.

For example,

&lt;pre&gt;&lt;code&gt;
// for testing only
string masterpart = &amp;quot;SOME PART NUMBER&amp;quot;;
// end testing value

// Connect to external (in this case SQL Server) database
System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(@”Provider=sqloledb; Data Source=server; Initial Catalog=Test; Integrated Security=SSPI;”);

// construct sql Select statement to retrieve data from external database.
string sqltext = “Select partnum,totalstock,descrip from Sales Where Partnum = ‘” + masterpart + “‘;”;
System.Data.OleDb.OleDbCommand com = new System.Data.OleDb.OleDbCommand(sqltext);

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

myDataReader.Read();
string res = myDataReader.ToString();
myConnection.Close();

return res;&lt;/code&gt;&lt;/pre&gt;


This should give you a starting point for debugging your code. If your database connection and SQL string are correct, your sample should return your expected result. If you don&amp;#39;t get your expected result, you may need to tweak your connection string or your SQL query.

Note - I haven&amp;#39;t tested the above code, I just rewrote a piece of your original code into a smaller test.

Eli

&lt;hr /&gt;

Eli Donahue

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>