data update using control RRS feed

  • Question

  • User-1547866623 posted


    I am new to programming, I am working on creating new web service that update database. My requirement is using a web services with vb.net.



    Friday, March 26, 2021 2:05 PM

All replies

  • User-939850651 posted

    Hi rani_shah19,

    According to your description, I created a simpe demo, you could refer to it:

    <head runat="server">
        <script src="Scripts/jquery-3.4.1.min.js"></script>
            $(function () {
                $('#UpdateBtn').on('click', function () {
                        url: 'WebService1.asmx/UpdateDataBase',
                        type: 'post',
                        contentType: 'application/json,charset=UTF-8',
                        data: {},
                        dataType: 'xml',
                        success: function (responseData) {
                            var result = responseData.getElementsByTagName("string")[0].childNodes[0].nodeValue;
                            if (result == "ok") {
                                console.log('update successfully!')
                            } else {
                                console.log('update failed...')
                        error: function (e) {
                            alert("something wrong.");
        <form id="form1" runat="server">
                <input type="button" id="UpdateBtn" value="Update" />
    Public Class WebService1
        Inherits System.Web.Services.WebService
        Public Function UpdateDataBase() As String
                'Code about update database
                'Update successfully then return result
                Return "ok"
            Catch ex As Exception
                'get exception then return result
                Return "failed"
            End Try
        End Function
    End Class

    But the part of updating the database needs to be coded appropriately according to your own situation.

    For more details ,you could refer to the use of  .asmx web service.

    If I misunderstood anything, please describe more details about your problem.

    Best regards,

    Xudong Peng

    Monday, March 29, 2021 7:00 AM