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/
Its not kUDVENKAT, its GUDvenkat. (Y)
How to connect Oracle database
thank you soooo much
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?
Sir can you put video of one small project then we come to know how to use all these regarding C# && asp.net..
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#?
SO deep making understanding and being helpful for us , thank you sir
no words for this wonderful teacher. thumbs up!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111
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.'
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
Very good ,Thank you
Respect dude!
thank you !!
I wish I found these videos a year ago. These are high quality ADO.net lessons
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 .
i get very knowledge from you sir
Hello! Still valid in 2018 for some projects!
nice
nonquery also excecutes read operations?
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.
how to insert data in multiple data in commandetext?
It is really wonderful that you explain all possibility and every aspect of the theme.
Brilliant Brilliant Absolutely Brilliant Tutorials
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..
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()?
how to create Sql connection file in c# Class
Does anyone knows how to insert multiple rows??
Thanks!
Excellent ! I love your tutorials.
Thanks for giving us these much stuff. Which helps me a lot lot….
Oh guy! You saved my marks. Today I had an exam and it went wonderful. All because of you. Thank you so much! 😊
file not found error occured at con.open()
plz help
Mr Venkat, thank you very much for your valueable lessons! These are the best .NET tutorials in Youtube
Thanks Venkat
Thank you so much for all your tutorials. I don't know what i would do without you !
I get an error with the line GridView1.DataBind();The intelesence does not show the DataBind() method at all.Thank you
Your explanations are clear and precise thank you good sir
can we have some videos on Xamarin please
awsome tutorials
why are all the comments indian ppl? upvote if you arent indian