Introduction:
In this sample describes how to build a distribution application which accesses MS SqlServer2000 on remoting service.
Using the code
Server
using System;
using System.Data;
using System.Data.SqlClient;
namespace www.treaple.com
{
public class Hello : System.MarshalByRefObject
{
public Hello()
{
Console.WriteLine("Hello actived");
}
~Hello()
{
Console.WriteLine("Hello destroyed");
}
public DataSet GetData()
{
string conn = "Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI";//newSqlConnectionSystem.Configuration.ConfigurationSettings.AppSettings["strconn"]);
SqlDataAdapter da = new SqlDataAdapter("select * from Products", conn);
DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}
}
}
Client
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Data;
Join the conversation! Your thoughts help the community grow.