Remoting项目时出错

Remoting项目时出错

本文介绍了实施.Net Remoting项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在实施.Net Remoting Project,但出现了一些问题,请帮帮我.
我将代理对象编码为客户端和服务器之间的通讯方式为:

Hi all,
I''m implementing .Net Remoting Project but it occurs some problem, pls help me.
I code proxy object to comunicate between client and server as:

public class clsComponent : MarshalByRefObject
    {
        public DataSet TransDetails(string strServer)
        {
            string strConnectString = "server = " + strServer + "; database = ImperialBank; UID=phuc;PWD=phuc";
            SqlConnection sqlCon;
            SqlDataAdapter sqlDataApt;
            string strQuery = "Select Transaction_Id as 'Transaction Id', Transaction_Date as 'Transaction Date', " +
                               "Credit, Debit, Bal_Amt as 'Balance Amount' from Transactions";
            sqlCon = new SqlConnection(strConnectString);
            sqlDataApt = new SqlDataAdapter(strQuery, sqlCon);
            DataSet ds = new DataSet();
            sqlDataApt.Fill(ds, "Transactions");
            return ds;
        }
        public IQueryable<CustomerDetail> fnGetAllEmp()
        {
            var c = from c1 in db.CustomerDetails
                    select c1;
            return c;
        }
}


客户端已连接到服务器,客户端调用 TransDetails() =>好的.但是客户端调用 fnGetAllEmp(),则会发生错误:
在程序集"System.Data"中,


Client was connected to server and client call TransDetails() => ok. But client call fnGetAllEmp(), it occur error:

Type 'System.Data.Linq.DataQuery`1[[ComponentApp.CustomerDetail, ComponentApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' in Assembly 'System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.


对不起,我的语言!


Sorry my language!

推荐答案



这篇关于实施.Net Remoting项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 14:22