CTOCIO IT专家网

天极传媒 比特网 | 天极网 | IT专家网 | IT商网 | 52PK游戏网 | 手机天极 | IT分众 |
IT专家网搜索

从Web Service中返回一个SqlConnection部件出错

作者: ,  出处:IT专家网, 责任编辑: 叶江, 
2005-12-15 14:20
  关于从Web Service中返回一个SqlConnection部件出错的问题,代码如下……应该如何解决啊?

  关于从Web Service中返回一个SqlConnection部件出错的问题,代码如下:

    private  SqlConnection Cn=null;
    private  SqlConnection AccCn=null;
    [WebMethod]
    public SqlConnection AppCn(String AccNo)
    {
        if (Cn != null)
            return;// Cn;
        if (AccNo == null)
        {
            SqlCommand com = new SqlCommand("select * from AppAccount Where AccNo='" + AccNo + "'", AccCn);
            SqlDataReader mreader = com.ExecuteReader();
            mreader.Read();
            String Connect_Str = "Data Source=" + mreader["AccServer"].ToString() + ";Initial Catalog=" + mreader["AccDataBase"].ToString();
            Connect_Str = Connect_Str + ";Persist Security Info=True;User ID=" + mreader["AccUser"].ToString() + ";Password=" + mreader["AccPassword"].ToString();
            Cn = new SqlConnection(Connect_Str);
        }
        else
        {
            Cn = new SqlConnection();
            Cn.ConnectionString = AccCn.ConnectionString;
        }
        Cn.Open();
        return Cn;
    }

错误:
Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface.

该如何解决啊?

……

网友评论

笔名 
请您注意:遵守国家有关法律、法规,尊重网上道德,承担一切因您的行为而直接或间接引起的法律责任。    IT专家网友拥有管理笔名和留言的一切权利。
  • 周排行榜
  • 月排行榜

邮件订阅

       
天极服务 | 关于我们 | 网站律师 | 加入我们 | 联系我们 | 广告业务 | 友情链接 | 我要挑错
All Rights Reserved, Copyright 2004-2008, Ctocio.com.cn
渝ICP证B2-20030003号 如有意见请与我们联系 powered by 天极内容管理平台CMS4i