LOCAL lo as "MyInterop.MyComm", ds lo = CREATEOBJECT("MyInterop.MyComm") ds = lo.GetDataset("HumanResources.Department") ? ds.ToString() && "System.Data.DataSet" ? type('ds.Tables') && Object ? ds.Tables.Count && error ? ds.Tables.Item(0).Rows.Item(0).Item(1) && error * this works and I get the result XMLTOCURSOR(ds.GetXML,'result') browseNeither ds.Tables.Item(0)... nor ds.Tables(0)... work. Any idea?
using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using System.Data; using System.Data.Sql; using System.Data.SqlClient; namespace MyInterop { [ClassInterface(ClassInterfaceType.AutoDual)] [ProgId("MyInterop.MyComm")] [ComVisible(true)] public class MyComm { public DataSet GetDataset(string tableName) { DataSet ds = new DataSet(); SqlConnection con = new SqlConnection("server=.\\sqlexpress;database=AdventureWorks;Trusted_connection=yes"); SqlDataAdapter adp = new SqlDataAdapter(String.Format("select * from {0}", tableName), con); adp.Fill(ds); return ds; } } }I am going to cross post this into .Net forum. Thanks in advance.