首页 新闻 会员 周边 捐助

C# 把数据录入 word中出错 说是集合要求成员不存在 ?????求助啊

0
[已关闭问题] 关闭于 2013-02-07 11:13

  object patentSortnum = "patentSortnum";
           doc.Bookmarks.get_Item(ref patentSortnum).Range.Text = strs[3].ToString();   

 

word 中是不是要建立标签啊 ,里面我也写上了

C# 把数据录入 word中出错 说是集合要求成员不存在 ?????求助啊

 object[] a = new object[]{
            "PatentName","PatentNum","PatentRegDate","patentSortnum","TradeClass1","TradeClass2","TradeClass3","TradeClass4","TradeClass5","TradeClass6","TradeClass7","TradeClass8","TradeClass9","Proposer","ProposerClass1","ProposerClass2","ProposerClass3","ProposerClass4","ProposerClass5","BankName","Accounts","Address","Phone","LinkMan","Mobile","UnitClass1","UnitClass2","UnitClass3","UnitClass4","PrizeClass1","PrizeClass2","PrizeClass3","PrizeClass4","PrizeClass5","PrizeCountrys","PrizeClass6","PrizeClass7","PrizeClass8","PrizeClass9","PrizeClass10","PrizeClass11","PrizeClass12","PrizeClass13","PrizeOthers","datum1","datum2","datum3","datum4","datum5","datum6" };
       
        object[] b = new object[50];
        SqlParameter p = new SqlParameter("@hid", hid);
        SqlDataReader sr = SqlHelper.ExecuteReader(SqlHelper.CONN_STRING_NON_DTC, CommandType.Text, "select * from NewHortation1 where NewHortation1Id=@hid", p);
        if (sr.Read())
        {
            b[0] = sr["PatentName"].ToString();
            if (Convert.ToInt32(sr["PrizeClassid"]) == 4 || Convert.ToInt32(sr["PrizeClassid"]) == 5 || Convert.ToInt32(sr["PrizeClassid"]) == 15)
            {
                b[1] = sr["PatentNum"].ToString();
            }
            else
            {
                b[1] = "ZL" + sr["PatentNum"].ToString();
            }

            b[2] = Convert.ToDateTime(sr["PatentRegDate"]).ToString("yyyy年MM月dd日");
            b[3] = sr["patentSortnum"].ToString();

程海的主页 程海 | 初学一级 | 园豆:11
提问于:2012-12-20 17:19
< >
分享
所有回答(1)
0

word 中 没有添加 标签原因

程海 | 园豆:11 (初学一级) | 2013-02-07 11:13
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册