Save data using asp net web services and jquery ajax

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 25

  • @mohammedbadran7840
    @mohammedbadran7840 9 ปีที่แล้ว +4

    I learned so much from your videos thnx a lot

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  9 ปีที่แล้ว +4

      +Mohammed Knight Thanks a bunch for taking your valuable time to give feedback. Means a lot. Glad you found the videos useful.
      Dot Net & SQL Server videos for aspiring software developers
      th-cam.com/users/kudvenkatplaylists?view=1&sort=dd
      If you need videos for offline viewing, you can order them using the link below
      www.pragimtech.com/Order.aspx
      Code Samples, Text Version of the videos & PPTS on my blog
      csharp-video-tutorials.blogspot.com
      Tips to effectively use our channel
      th-cam.com/video/y780MwhY70s/w-d-xo.html
      Want to receive email alerts, when new videos are uploaded, please subscribe to our channel using the link below
      th-cam.com/users/kudvenkat
      Please click the THUMBS UP button below the video, if you think you liked them
      Thank you for sharing these links with your friends
      Best
      Venkat

    • @mohammedbadran7840
      @mohammedbadran7840 9 ปีที่แล้ว +1

      +kudvenkat
      thnx a lot from Egypt

  • @tung.nguyen.29
    @tung.nguyen.29 9 ปีที่แล้ว +1

    Nice tutorial, good job guy!

  • @mohammedtawane
    @mohammedtawane 6 ปีที่แล้ว

    I really enjoyed your clear video, Although i was looking different.
    Can you pls guide me how to insert file in to database using jquery ajax through webservice?
    I appreciate you

  • @artemboss1999
    @artemboss1999 9 ปีที่แล้ว

    a good video tutorial
    thanks

  • @bojanasamardzioska3040
    @bojanasamardzioska3040 8 หลายเดือนก่อน

    💯

  • @Rocky19700101
    @Rocky19700101 5 ปีที่แล้ว

    Thank you for your excellent video, I got successful on search and get all data from web service, but always fails on saving data to database, Just don't know what cause the problem?

  • @tolaskaplan
    @tolaskaplan 6 ปีที่แล้ว

    I have a question - how are you passing a json string in the ajax and recieving an employee object in the web service?

  • @gauravdubey4002
    @gauravdubey4002 9 ปีที่แล้ว +1

    Hi kudvenkat,can u include the upload file in the same form and along side saving that filename to database and file to the folder.

  • @FabianoAugustoperfil
    @FabianoAugustoperfil 7 ปีที่แล้ว

    very good class

  • @pxanimate
    @pxanimate 9 ปีที่แล้ว

    Thank you so much . Great Tutorial ...
    I have a question
    How can i create the Employee class object ...?

  • @jclinares6874
    @jclinares6874 8 ปีที่แล้ว

    aunque no entendi lo que hablaste, me ayudo a comprender mucho (y)

  • @vshah2703
    @vshah2703 ปีที่แล้ว

    sir
    in web service where did you get the value name that is passed to parameter @Name, I am unable to pass

  • @ahmedshahabaz8370
    @ahmedshahabaz8370 9 ปีที่แล้ว

    This example didn't work for me. I used visual studio 2013 and Microsoft SQL server 2012. I uncommented [System.Web.Script.Services.ScriptService] this.
    Firstly I had to pass Id as a parameter to the stored procedure. So my stored procedure had 4 parameters.
    Secondly passing the parameter from html page to asmx method didn't work. So I had to change the parameter type of the AddEmployee(Employee emp ) method to AddEmployee(string name,string gender , int salary). I passed the three parameter from the html page.I counted the number of rows in tblEmployee table and incremented it by one and assigned it to the emp.Id this was passed as the @Id parameter to the stored procedure.
    Please suggest me if I could have done this in another way. Where I could have kept the Employee type parameter of the AddEmployee method.

  • @eksrikanth06
    @eksrikanth06 9 ปีที่แล้ว

    can you pls share an example of saving Image(from picturebox) to Sqlserver table with Image(datatype)

  • @vimalupadhyay1883
    @vimalupadhyay1883 6 ปีที่แล้ว

    Hello Venkat Sir, i am making one application by seeing your videos, I implementing Insert/Add functionality same as in this video, but sometimes my application insert data, and sometimes its not, but in both cases it gives error [object,object] ,even it successfully insert data it go to error function, not success function and give error [object object] can you provide some guidance on what i need to do? i already viewed this video several times and check everything as per it, but still getting this issue

    • @pastuh
      @pastuh 6 ปีที่แล้ว

      If you get this error, that means you get Object.
      Need to use .each function, to get all elements from object

  • @codewizard5327
    @codewizard5327 6 ปีที่แล้ว

    It kinda works, but in real world application, you might want to add a small piece of html at the end of tbody instead of success:GetAllEmployees()

  • @rahulrathaur8039
    @rahulrathaur8039 5 ปีที่แล้ว

    Hello sir.
    How Can I Send Image from Ajax to Webservice

  • @SwiftLearn
    @SwiftLearn 5 ปีที่แล้ว

    Get employees tutorial please.

  • @donfeto7636
    @donfeto7636 5 ปีที่แล้ว

    i would rather write the data like that data:Json.stringify({emp:employee})
    we have to stringify anything that isn't string cuz the http accept only string to be passed in url any complex type have to stringifyed first

  • @Shahzaibkhan-xr7lr
    @Shahzaibkhan-xr7lr 3 ปีที่แล้ว

    For those who are getting error [object object] uncomment this library [System.Web.Script.Services.ScriptService] in your asmx file

  • @pablosalas8586
    @pablosalas8586 8 ปีที่แล้ว

    and with update??
    SP:
    public void UpdateEmployee(Employee emp)
    {
    string cs = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
    using (SqlConnection con = new SqlConnection(cs))
    {
    SqlCommand cmd = new SqlCommand("spUpdateEmployee", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add(new SqlParameter()
    {
    ParameterName = "@Id",
    Value = emp.ID
    });
    cmd.Parameters.Add(new SqlParameter()
    {
    ParameterName = "@Name",
    Value = emp.Name
    });
    cmd.Parameters.Add(new SqlParameter()
    {
    ParameterName = "@Gender",
    Value = emp.Gender
    });
    cmd.Parameters.Add(new SqlParameter()
    {
    ParameterName = "@Salary",
    Value = emp.Salary
    });
    con.Open();
    cmd.ExecuteNonQuery();
    }
    }
    *********************************************
    $('#btnUpdateEmployee').click(function () {
    var employee = {};
    employee.ID = $('#txtId').val();
    employee.Name = $('#txtName').val();
    employee.Gender = $('#txtGender').val();
    employee.Salary = $('#txtSalary').val();
    $.ajax({
    url: 'EmployeeService.asmx/UpdateEmployee',
    method: 'POST',
    data: '{emp: ' + JSON.stringify(employee) +'}',
    contentType: "application/json; charset=utf-8",
    success: function () {
    getAllEmployees();
    },
    error: function (err) {alert(err); }
    });
    });
    doesn't work!. :(