July 8, 2020
  • 2:20 am Disney Super Speedway – Free Game Review Gameplay Trailer for iPhone iPad iPod
  • 2:15 am Mua ổ cứng SSD 120Gb giá rẻ trên Shopee | Hướng dẫn tự nâng cấp SSD tại nhà
  • 2:12 am Yamie’s chia sẻ | KINH NGHIỆM ĐỖ THỦ KHOA NGÀNH DIỄN VIÊN THẬT NHẤT | MUỐN THI NÊN XEM
  • 2:06 am Đi Và Yêu – Soobin Hoàng Sơn | Official Lyrics Video
  • 2:03 am CÁCH LÀM TRỨNG CÚT SỐT CHUA NGỌT ĐẬM ĐÀ THƠM PHỨC – CKK



Text version of the video

Slides

All ADO .NET Text Articles

All ADO .NET Slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

In this video we will learn about
1. The Purpose of the SqlCommand object
2. Creating an instance of the SqlCommand class
3. When and how to use ExecuteReader(), ExecuteScalar() and ExecuteNonQuery() methods of the SqlCommand object.

Nguồn: https://chaoticpharmacology.com/

Xem thêm bài viết khác: https://chaoticpharmacology.com/cong-nghe/

admin

RELATED ARTICLES

40 COMMENTS

  1. Binod Karki Posted on July 7, 2020 at 7:09 am

    Its not kUDVENKAT, its GUDvenkat. (Y)

    Reply
  2. Amit Pandey Posted on July 7, 2020 at 7:09 am

    How to connect Oracle database

    Reply
  3. safeer khan Posted on July 7, 2020 at 7:09 am

    thank you soooo much

    Reply
  4. Nimesh Patel Posted on July 7, 2020 at 7:09 am

    hello sir! why we have done totalrows.toString() when already the method executNonQuey is returning a integer value which we are storing in an integer variable?

    Reply
  5. MONISHA N Posted on July 7, 2020 at 7:09 am

    Sir can you put video of one small project then we come to know how to use all these regarding C# && asp.net..

    Reply
  6. Sarah Ahmed Posted on July 7, 2020 at 7:09 am

    in Response.Write() we can use "n" instead of "<br/>", right? And why is it that "<br/>" works anyway? Because I don't think that would work in C++'s cout. Is <br> defined for C#?

    Reply
  7. Samre Alam Posted on July 7, 2020 at 7:09 am

    SO deep making understanding and being helpful for us , thank you sir

    Reply
  8. MINI_ RAJnIKANT Posted on July 7, 2020 at 7:09 am

    no words for this wonderful teacher. thumbs up!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111

    Reply
  9. avinash reddy Posted on July 7, 2020 at 7:09 am

    Hi,
    Following code is not working.

    using System;

    using System.Data.SqlClient;

    using System.Configuration;

    namespace TestData

    {

    public class Program

    {

    public static void Main()

    {

    string CS= ConfigurationManager.ConnectionStrings["Connection"].ConnectionString;

    SqlConnection con = new SqlConnection(CS);

    SqlCommand cm = new SqlCommand("");

    cm.CommandText = "select *from Students_Table";

    cm.Connection = con;

    con.Open();

    SqlDataReader dr =cm.ExecuteReader();

    while(dr.Read())

    {

    Console.WriteLine(dr["Id"]+"t"+dr["Name"]+"t"+dr["Course"]);

    }

    cm.CommandText = "delete from Students_Table where Id=1";

    int count = cm.ExecuteNonQuery();

    Console.WriteLine("No of rows deleted are" + count);

    cm.CommandText = "select count(Id) from Students_Table";

    count = (int)cm.ExecuteScalar();

    Console.WriteLine("Total students are" + count);

    con.Close();

    }

    }

    }

    If I run all execute methods at a time, on opening a connection only once. It is throwing an error as below.

    There is already an open DataReader associated with this Command which must be closed first.'

    Reply
  10. Fran Bellagamba Posted on July 7, 2020 at 7:09 am

    I have no words man, thank you so much for these awesome and simple explanations. I have a test in 9 days and haven't managed to study properly because of my job. I sit here 2 or 3 hours a day listening to you and I get a full week of class in a day

    Reply
  11. Akkaradech Srithongchai Posted on July 7, 2020 at 7:09 am

    Very good ,Thank you

    Reply
  12. gloryland in gloryland Posted on July 7, 2020 at 7:09 am

    Respect dude!

    Reply
  13. Hasan Othman Posted on July 7, 2020 at 7:09 am

    thank you !!

    Reply
  14. Chakra Bracelet Posted on July 7, 2020 at 7:09 am

    I wish I found these videos a year ago. These are high quality ADO.net lessons

    Reply
  15. SK SUBHI Posted on July 7, 2020 at 7:09 am

    I'm facing a problem with web application I don"t get the data in the GridView at the browser but in the Windows Forms Application i can .

    Reply
  16. gopal bharadva Posted on July 7, 2020 at 7:09 am

    i get very knowledge from you sir

    Reply
  17. name Posted on July 7, 2020 at 7:09 am

    Hello! Still valid in 2018 for some projects!

    Reply
  18. Sergio Esteban Posted on July 7, 2020 at 7:09 am

    nonquery also excecutes read operations?

    Reply
  19. Evo Stefanov Posted on July 7, 2020 at 7:09 am

    I have to say thank you for creating this playlist. These videos are just such a great resource. Having said that, I have been struggling with a problem for the last few days and I just can't find the help to solve it all the way. I am not senior in C# so forgive me if I am missing something simple here. Here is the question – I am trying to write a script in SSIS which converts a System.Object into a list of strings so I can then select the Max value from all the strings, how can I do that exactly because using the data adapter just doesn't work for me. I don't care if i convert to a list of strings or a data column, or an array – I just need to select the Max value stored in the System.Object. Please help! And thanks again for these videos.

    Reply
  20. 0prirate Posted on July 7, 2020 at 7:09 am

    how to insert data in multiple data in commandetext?

    Reply
  21. Katalin Németh Posted on July 7, 2020 at 7:09 am

    It is really wonderful that you explain all possibility and every aspect of the theme.

    Reply
  22. Programmers Heaven Posted on July 7, 2020 at 7:09 am

    Brilliant Brilliant Absolutely Brilliant Tutorials

    Reply
  23. Rakesh Kusuma Posted on July 7, 2020 at 7:09 am

    Hi Venkat
    i am a beginner to ADO.Net
    This video is very help for learning things quicky..thanks alottt
    i tired delete command with ExecuteReader instead of ExecuteNonQuery.. and it deleted the row from table
    so what is the main difference between ExecuteReader and ExecuteNonQuery
    Please Help to understand..

    Reply
  24. Sandeep Adode Posted on July 7, 2020 at 7:09 am

    Why do we have to convert the total rows to ToString in Response.Write()? Can't we simply write as TotalRows and not TotalRows.ToString()?

    Reply
  25. Aamez Khan Pathan Posted on July 7, 2020 at 7:09 am

    how to create Sql connection file in c# Class

    Reply
  26. Ameem Ansari Posted on July 7, 2020 at 7:09 am

    Does anyone knows how to insert multiple rows??

    Reply
  27. Dominique Reinhardt Schneider Posted on July 7, 2020 at 7:09 am

    Thanks!

    Reply
  28. Sergi Posted on July 7, 2020 at 7:09 am

    Excellent ! I love your tutorials.

    Reply
  29. vital kumar Posted on July 7, 2020 at 7:09 am

    Thanks for giving us these much stuff. Which helps me a lot lot….

    Reply
  30. Kinjal Kaushik Posted on July 7, 2020 at 7:09 am

    Oh guy! You saved my marks. Today I had an exam and it went wonderful. All because of you. Thank you so much! 😊

    Reply
  31. Kishan Bhimani Posted on July 7, 2020 at 7:09 am

    file not found error occured at con.open()
    plz help

    Reply
  32. Ivan Sazhin Posted on July 7, 2020 at 7:09 am

    Mr Venkat, thank you very much for your valueable lessons! These are the best .NET tutorials in Youtube

    Reply
  33. Semi Kolon Posted on July 7, 2020 at 7:09 am

    Thanks Venkat

    Reply
  34. La fille zen Posted on July 7, 2020 at 7:09 am

    Thank you so much for all your tutorials. I don't know what i would do without you !

    Reply
  35. Leave the Matrix Posted on July 7, 2020 at 7:09 am

    I get an error with the line GridView1.DataBind();The intelesence does not show the DataBind() method at all.Thank you

    Reply
  36. Muaz Abdool Posted on July 7, 2020 at 7:09 am

    Your explanations are clear and precise thank you good sir

    Reply
  37. Govind Sharma Posted on July 7, 2020 at 7:09 am

    can we have some videos on Xamarin please

    Reply
  38. Sunil kumar M Posted on July 7, 2020 at 7:09 am

    awsome tutorials

    Reply
  39. John Smith Posted on July 7, 2020 at 7:09 am

    why are all the comments indian ppl? upvote if you arent indian

    Reply
LEAVE A COMMENT