使用Web服务将数据插入数据库 [英] insert data into database using web services

查看:109
本文介绍了使用Web服务将数据插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友
我想使用webService将值插入数据库.我尝试搜索,但没有得到任何正确的信息.请帮忙!

Hello friends
I want to insert values into database using webService. I tried searching but i did not get any proper info. please help!!

推荐答案

这里是一个选项:
用于Microsoft SQL Server的本机XML Web服务概述 [ ^ ]

问候
Espen Harlinn
Here is an option:
Overview of Native XML Web Services for Microsoft SQL Server[^]

Regards
Espen Harlinn


This link[^] might help you.


您需要在WebService中创建一个WebMethod
它将与您互动的数据库

You Need to create One WebMethod in WebService
which will interact to you DataBase

[WebMethod]
        public Void InsertItems(string FirstName)
        {
            try
            {

            }
            catch (Exception ex)
            {
            }
            finally
            {
            }
        }





创建方法后,您需要在Web应用程序中添加其引用

然后,您需要创建该Web服务的对象






after Creating Your Method you need to add the reference of it in your web application

Then you need to create an Object of that webservice
Like

  Webervice.MyWebservice Obj = new Webervice.MyWebservice()

          Obj.//Here You will get your Method that is ''InsertItems()''
and then you just need to pass your Parameters to that like 

 obj.InsertItems(txt_FirstName.text);


这篇关于使用Web服务将数据插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆