您的位置:程序门 -> .net技术 -> web services



如何将webservice 里调用的数据库数据,写入另一个数据库表中?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


如何将webservice 里调用的数据库数据,写入另一个数据库表中?
发表于:2007-12-23 19:28:53 楼主
如何将webservice   里调用的数据库数据,写入另一个数据库表中?
例:
    [webmethod]
        public   dataset   getcustom()
        {
                sqlconnection   conn;
                sqldataadapter   mydata;
                dataset   ds;
                string   cmdstring   =   "select   *   from   customers";

                conn   =   new   sqlconnection("server=lcg;   uid=   sa   ;pwd=123;database=northwind");
                mydata   =   new   sqldataadapter(cmdstring,   conn);

                ds   =   new   dataset();
                mydata.fill(ds,   "customers");

                return   ds;
        }


我如何能将这里所取得的数据表写入另一个数据库表中呢?求教!真心求教!
发表于:2007-12-24 17:30:231楼 得分:0
调用webservice获得的xml数据转换成ds,循环插到目标表中,就可以了。
发表于:2008-01-02 17:10:492楼 得分:0
不用转吧,返回类型就是dataset
返回后在client端直接用就好了
ado.net


快速检索

最新资讯
热门点击