usingSystem;
usingSystem.Data;
usingSystem.Data.SqlClient;
namespaceRemoteObject
{
publicclassMyObject:MarshalByRefObject
{
publicDataSetGetData()
{
SqlConnectionconn=newSqlConnection(System.Configuration.ConfigurationSettings.AppSettings["strconn"]);
SqlDataAdapterda=newSqlDataAdapter("select*fromUBI_ProvinceMaster",conn);
DataSetds=newDataSet();
da.Fill(ds);
returnds;
}
}
}
RemoteObject.MyObjectapp=(RemoteObject.MyObject)Activator.GetObject(typeof(RemoteObject.MyObject),System.Configuration.ConfigurationSettings.AppSettings["ServiceURL"]);
DataTabledt=app.GetData().Tables[0];
foreach(DataRowdrindt.Rows)
{
Console.WriteLine(dr["iPrMId"]+""+dr["vPrMName"]);
}
Console.ReadLine();
//RemoteObject.MyObjectapp=(RemoteObject.MyObject)Activator.GetObject(typeof(RemoteObject.MyObject),System.Configuration.ConfigurationSettings.AppSettings["ServiceURL"]);
RemoteObject.MyObjectapp=newRemoteObject.MyObject();