我在用WEB引用事,提示:
类型 System.ComponentModel.ISite 的成员 System.ComponentModel.MarshalByValueComponent.Site 是接口,因此无法将其序列化。
请问问题出在哪?
还有就是,Web引用时,应注意什么?谢谢各位
类型 System.ComponentModel.ISite 的成员 System.ComponentModel.MarshalByValueComponent.Site 是接口,因此无法将其序列化。
请问问题出在哪?
还有就是,Web引用时,应注意什么?谢谢各位
解决方案 »
- 连接框架问题
- ajax 有创意的问题,分我会追加
- 怎么对DataGrid的编辑只对某些列进行编辑??
- 添加web中的treeview,点击Nodes出现指定的转换无效,怎么回事啊?
- “找不到可安装的 ISAM”怎么回事,在线等
- 关于treeview的HTC,点击节点的内容,如何使之折叠或者展开
- sql语句为什么不能执行
- *****易管通:不需要写一行程序代码即可生成MIS系统的WEB信息平台***********
- 在ASP.net中,如何连接远程oracle服务器
- 能不能作到这样的功能,让很多域名指到我的webserver上的某个页面
- 如何得到hashtable中特定键的值,并更新??100分的题。
- 请问一下,大家在用2005写程序的时候,页面的布局和美化是用哪个工具?
那么对于 引用服务里面的方法 必须都是实现了的
即必须是类中定义了的 不能是接口.
[WebMethod]
public DataTable GetTab(string tabid)
{
string ConnString = System.Configuration.ConfigurationSettings.AppSettings["ConnectiongSqlServer"];
SqlConnection con=new SqlConnection(ConnString);
SqlCommand topcmd=new SqlCommand("GetsysTab",con);//new
topcmd.CommandType = CommandType.StoredProcedure;//new
topcmd.Parameters.Add(new SqlParameter("@tabid",SqlDbType.VarChar,20));
topcmd.Parameters["@tabid"].Value=tabid;
DataSet ds_Tabs =new DataSet();
SqlDataAdapter adapter = new SqlDataAdapter(topcmd);
adapter.Fill(ds_Tabs,"thisTab");
return ds_Tabs.Tables["thisTab"];
}谢谢各位
因为DataTable 不能序列化
[WebMethod]
public DataTable GetTab(string tabid)
{
string ConnString = System.Configuration.ConfigurationSettings.AppSettings["ConnectiongSqlServer"];
SqlConnection myConn=new SqlConnection(ConnString);
SqlCommand topcmd=new SqlCommand();//new
topcmd.Connection= myConn;
topcmd.Parameters.Add(new SqlParameter("@tabid",SqlDbType.VarChar,20));
topcmd.Parameters["@tabid"].Value=tabid;
topcmd.CommandText="GetsysTab";
topcmd.CommandType = CommandType.StoredProcedure;//new
DataSet ds_Tabs =new DataSet();
SqlDataAdapter adapter = new SqlDataAdapter(topcmd);
adapter.Fill(ds_Tabs,"thisTab");
return ds_Tabs.Tables["thisTab"];
}
public DataSet GetTab(string tabid)
{
//...........
return ds_Tabs;
}
不能返回DataTable么?要想返回表中的数据,那应该如何改写?