注册|登录

联系电话:024-31891684  13390130939
沈阳软件公司--沈阳软件定制

沈阳软件开发_沈阳软件公司_沈阳软件定制/软件/最新技术

Latest technology最新技术

如何读取一个webservers接口

浏览量:4636

         有些客户往往要求读取一个接口中的数据,给了接口,读取出来了,但是如何转换成自己数据库中的数据呢?

         首先要添加Webservers, 在下面红框中输入Url:

         1 实例化对象:

             引用名. CollectionService obj=new引用名. CollectionService();

         2调取方法:

             System.Xml.XmlNode xml = obj.方法名("用户名", "密码");

         3.读取xml

DataSetds = new DataSet();

            // 读取XML字符串到XmlNodeReader中,再转化成Dataset

            XmlNodeReader reader = new XmlNodeReader(xml);

            {

                ds.ReadXml(reader);

            }

           现在已经把从接口中读取的数据绑定到了你要绑定中的地方。

           

            #region网站数据与远程数据混排

                        if (paixu == "0")

                        {

 

 

foundRows = dt.Select(" " + valuelist + "  ", " lzjiage " + paixutype1 + ", lzzhongliang " + paixutype2 + ", lzjingdu " + paixutype3 + " , lzyanshe " + paixutype4 + ", lzqiegong " + paixutype5 + " ");

                        }

                        if (paixu == "1")

                        {

                            foundRows = dt.Select(" " + valuelist + "  ", " lzzhongliang " + paixutype2 + " ,lzjiage " + paixutype1 + " , lzjingdu " + paixutype3 + " , lzyanshe " + paixutype4 + ", lzqiegong " + paixutype5 + "   ");

                        }

                        if (paixu == "2")

                        {

                            foundRows = dt.Select(" " + valuelist + " ", " lzjingdu " + paixutype3 + ", lzzhongliang " + paixutype2 + " ,lzjiage " + paixutype1 + " , lzyanshe " + paixutype4 + ", lzqiegong " + paixutype5 + "   ");

                        }

                        if (paixu == "3")

                        {

                            foundRows = dt.Select(" " + valuelist + " ", " lzyanshe " + paixutype4 + " , lzjingdu " + paixutype3 + ", lzzhongliang " + paixutype2 + " ,lzjiage " + paixutype1 + " ,lzqiegong " + paixutype5 + "  ");

                        }

                        if (paixu == "4")

                        {

                            foundRows = dt.Select(" " + valuelist + "  ", " lzqiegong  " + paixutype5 + "  ,lzyanshe " + paixutype4 + " , lzjingdu " + paixutype3 + ", lzzhongliang " + paixutype2 + " ,lzjiage " + paixutype1 + "  ");

                        }

 

                          //dt.Clear();

 

这样就把数据混排到了数据库数据中了。

沈阳团购网|营口网站制作|沈阳软件公司|软件定制|网站建设|加盟易势|提交问题