在用Remoting时遇到的一个问题:一个继承类
[Serializable]
public class MyDataSet: DataSet
{
//一些简便的方法
}在一个继承 MarshalByRefObject的类的实例中用方法返回MyDataSet实例,如:
public MyDataSet GetItemList()
{
MyDataSet myDataSet;
//myDataSet的获取
return myDataSet;
}最后,在客户端调用服务器端的GetItemList时,报错:未找到反序列化 MyDataSet 类型对象的构造函数。什么问题,我要怎么做???
[Serializable]
public class MyDataSet: DataSet
{
//一些简便的方法
}在一个继承 MarshalByRefObject的类的实例中用方法返回MyDataSet实例,如:
public MyDataSet GetItemList()
{
MyDataSet myDataSet;
//myDataSet的获取
return myDataSet;
}最后,在客户端调用服务器端的GetItemList时,报错:未找到反序列化 MyDataSet 类型对象的构造函数。什么问题,我要怎么做???
解决方案 »
- 在对控件进行自绘时,如何能插入图片
- vs开发WAP怎么来调试啊
- 怎样在数据库操作类中显示输出最终执行的sql语句?
- 实在没辙了,笨女子,高分求解socket中ManualResetEvent 多线程操作问题
- 命名空间“Microsoft.Office”中不存在类型或命名空间名称“Interop”(是缺少程序集引用吗?)
- 关于Role的问题
- 字符串转换的问题?
- c#读取pdf文件项目源码
- 在C#中,如何将一个int转换成一个byte array,又如何将一个byte array转换成一个int呢?
- dictionary的并发问题
- 在线等待,高分求救,谁看出代码中的问题,马上给分100!!!
- 请问一下b/s中绝对路径的问题~~
/// 反序列化
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
public EntityData(SerializationInfo info,StreamingContext context)
{
DataTable dtTmp;
DataSet dsTmp,dsTmp1;
string strSchema; //获取序列化内容
strSchema= ((string)(info.GetValue("XmlSchema",typeof(string))));
if ((strSchema != null))
{
//生成临时 DataSet
dsTmp= new DataSet();
dsTmp1= new DataSet();
dsTmp.ReadXmlSchema(new XmlTextReader(new StringReader(strSchema)));
//加入表
for(int i= dsTmp.Tables.Count - 1; i >= 0; i--)
{
dtTmp= dsTmp.Tables[i];
dsTmp.Tables.Remove(dtTmp); dsTmp1.Tables.Add(dtTmp);
}
for(int i= dsTmp1.Tables.Count - 1; i >= 0; i--)
{
dtTmp= dsTmp1.Tables[i];
dsTmp1.Tables.Remove(dtTmp); this.Tables.Add(dtTmp);
} //其它参数
this.DataSetName= dsTmp.DataSetName;
this.Prefix= dsTmp.Prefix;
this.Namespace= dsTmp.Namespace;
this.Locale= dsTmp.Locale;
this.CaseSensitive= dsTmp.CaseSensitive;
this.EnforceConstraints= dsTmp.EnforceConstraints;
this.Merge(dsTmp, false, System.Data.MissingSchemaAction.Add);
}
this.GetSerializationData(info, context);
}