I'm gonna be honest here. You have the best format of transferring coding knowledge I've ever experienced. The way you simple things down, explain why you do everything, your clear/calm sounding voice, even the little 'pro tips' you throw in every video like explaining 'tab+tab' shortcuts, explaining what a "ThrowNewException()" does... Also, if I'm stuck with something in your videos you somehow magically know what I need to learn to understand the next step and refer me to one of you other videos that teach me things I need for the next step. I honestly can say I learned more in 2 weeks of watching your videos daily than several months at college. They just teach you stuff without really explaining the "why" behind it, so you end up googling it for yourself and spend a ton of time. Thanks for the free knowledge and keep up the good work!
@@IAmTimCorey He's completely right. You, sir, are the best programming tutorial creator I've ever had the pleasure of learning from. I absolutely appreciate your hard work and dedication to enriching everyone's understanding. Thanks!
Literally the only tutorials I can follow, he actually knows what he is doing! Other people simply speed through everything and don't explain what they are doing...
@@IAmTimCorey Another old guy here to endorse your video! I've been doing this for over forty years, and it still surprises me how we all still stampede down the same roads, reinventing the wheel, year after year. The problem is, we rarely end up with anything better than we had before ... and quite often it's worse! Once an interface has been tested, debugged, and has been working for years, there'd better be a REALLY good reason to come up with a "better" solution. The problem with Microsoft over the years has been a culture of "this'll do" combined with a very short attention span. Just Google search accessing a database from a .NET program and see how many different flavors of access methods there are (ODBC, and so on). Your video introduced me to Dapper, and I think it's just the right blend of functionality and flexibility. Most of us just want to get our applications working well, with the minimum of effort. We want them to just run and run, year after year, with minimal drama. Something that works "most of the time" is pretty worthless, in the long run. Thanks again Mate! A really nice, well structured instruction.
This is the best tutorial I have ever watched, seriously. I really feel like you are sitting right next to me explaining everything, even the things I know, but that just makes it better. Good stuff brother. Really good stuff.
0:00 - Intro 0:34 - Data base connection options: ADO, Entity Framework, Dapper 4:53 - Creating Demo Application: Win Forms 6:38 - Demo Database and Data Model 11:23 - Connection string: helper class 14:58 - Adding connection string 19:45 - Using connection string with helper class 22:25 - Recap 22:40 - Creating a UI form for displaying the data 25:24 - Wiring up the UI form: C# code design 30:24 - Wiring up the UI form: list box info 33:57 - Wiring up the UI form: data access from data base with Dapper 43:47 - Wiring up the UI form: debugging and list box bindings 50:05 - Wiring up the UI form: recap and notes on good practice for data access 51:57 - Stored procedures 58:05 - Explaining demo code so far 1:02:46 - Storing in data base: UI form design and wiring 1:08:26 - Storing in data base: C# code 1:15:08 - Storing in data base: Recap 1:16:04 - Summary and concluding remarks Welcome to "C# Data Access" playlist.
You're a God sent to students like me. I'm working on a School project and this may just be what I needed exactly. Thank you so much good sir. I've watched the whole thing.
Dude, I've watched a lot of tutorials, and you're among the (if not THE) best I've seen. Very thorough, organized, efficient, and clear. Thank you for these, really great work!
Leaving the listbox refresh debugging was downright awesome. You rarely get a chance to watch videos where everything doesn’t go perfectly - which never, ever happens in real life. Thx!
Others have said it, I just want to reaffirm it, your teaching style is absolutely exceptional. I am greatly appreciative to have come across your video's, this video and another on building a SQL Database have helped me tremendously with a project I'm currently working on. I'll be checking out some of your paid courses in the future as I need, I feel confident I'll get every penny's worth after learning from these well paced, well thought out, thorough but not overloading, free tutorials. Thank you for sharing your knowledge in such a clear and comprehensive way! 👏
this is awesome, literally over the top explanation. I cant thank you enough. i'm getting into database now, and this was extremely helpful. i already subscribed to you and will checkout your lessons. youtube is full of bad instructors and it is a bless to find people like you as it is very rare. in the past month I started learning MVVM, WPF and xaml and now sql with dapper. it is fun yet very challenging. hopefully it'll be rewarding. i'll surely watch and check most of your lessons regarding databases.
I recommend Tim's intro to SQL course on his website; I watched this C# to SQL video, then took the course. When I came back to watch a second time, I understood the C# content on a much deeper level. Thanks Tim!
Really helpful tutorial very detailed only problem i had was "connection string" not working. So in "visual studio" I went to tools >connect to database and followed the wizard and after completion just copied the connection string from there and pasted in the APP. config file and did not get any errors after that.
@@abal6127 you're missing the providerName="System.Data.SqlClient" in your connection string. Is the way c# knows what type of SQL engine it has to use.
TIm!! hi, its me again hehe im sorry to bother you. Im doing this tutorial, and i have come with a interesting question. Lets say that i want to add a Photo of the person that i seach in the text box. and display the photo on a picture box. Is there a way to store images into sql server and then talk to the database and get that image and put it into a picture box? Thank you for your time
There are a few options here, depending on your needs. You can store the image on your file server somewhere and just store the file path to the image in your SQL Server. That will greatly reduce your database size, especially if more than one row uses the same image. It will also make database backups much easier, since they will be a LOT smaller. The second option is to use the Varbinary(max) type. The third is to use the File Stream option. This last option is recommended for files over 1MB but if you decide to go that way, you add a lot of complications including the fact that you cannot use a SQL login to access the data. To undertake option two or three, check out the answer on this post: stackoverflow.com/questions/39354100/unable-to-insert-file-stream-into-sql-filetable-using-dapper-net
After a looking at a first video (Practical C# - Generics) , I delved into this one. I've been an SQL Server DBA and BI developer for years and, although being an absolute rookie with C#, this video makes everything crystal clear as you take the time to explain every step you take in the development of a new solution. So, thumbs up and a big thank you for the time and efforts you put in this learning material. By far the best and most addictive training material I've seen in years.
Not with Microsoft SQL Server, but if you wanted to use MySQL then yes, you could. You would need to change your web.config's connection string to properly point to a MySQL server but otherwise it should work.
Tim, I am so grateful for this video. All of them really. But, this one and the Stored procedure vid has helped me a ton recently. I've been developing in C# for a few years now and have worked primarily with EF. Can't tell you how many times I've had some random issue with EF. Large and small. My final straw was trying to return stored procedure data to a Vue.js axios call. The SP worked fine on the SQL server side, but EF freaked out each time I requested the data using the stored procedure. (A frustrating error code if anyone is interested in seeing it) Finding this vid allowed me to quickly follow and connect with Dapper. Making my SP call supeeeeeeeeeeer easy. With EF I was constantly limited to building a View from the SQL side. Making everything really slow and cumbersome. Thank you for what you do. You've helped me improve my skills in more ways I can convey here.
Even though it's 6 years old, I keep coming back to this video whenever I need a refresher. The way in which the concepts are presented is very thorough and easy to follow. I could like this video over and over again if possible. Many thanks Tim.
just so you know, there are a lot of people out there that teaches C# and programming etc, you have a unique way of teaching that is easy to understand and a pleasure to watch, thanks for all the videos you put out there.Looking forward to keep learning from your videos.One more thing i like is, how you refer to your experience and approach to coding, like finding the easiest way to accomplish a task, many developers think that creating ultra complicated code makes them look smarter, nothing far from the truth. We should spent more time solving problems and less time memorizing complex syntax.I always go back to your videos to refresh some topics before I start coding, so again, great work and thank you for your effort creating this material.
I have an application administration background. Over the years I have written many custom scripts to pulling and merging data from the underlying databases to bypass and automate slow tedious and error prone UI activity. Your style resonates with me and is helping me break through some learning barriers I have with C# and migrating to command line scripts to creating tools with a GUI front end. Thank you.
Tim, I have watched this video no less than 4 times from start to finish. It does such a wonderful job in explaining how Dapper works and what it does. I am already starting to use Dapper in a Model Railroading database app I am working on (I am retired). I will contact you at some point separately about something strange that VS is flagging as an Access limitation (CS0050 error) but I agree with you that Dapper is a super simple and powerful way to connect to a database. This video allowed me to take my learnings, change the methods, use a different database, yet get it working beautifully with Dapper to get data in and out. PS - I loved your SQL course, it was super detailed and super clear! Thanks :-)
I used your string helper code as well! Put that into my app. I also think your naming of key columns makes a lot of sense. I used to definitively design my keys as "pkCustomer" for the primary iD and then "fkCustomer" for the foreign key, however because you name ALL primary keys "Id", when one is working with queries, it makes it so much easier to see which is the "One" and which is the "Many". I can tell that you probably migrated to this naming convention over time based on experience :-)
I'm glad this video came up in my Google search. It's easy to follow and the pacing is perfect. Thanks to this video, I managed to finish up an application in much less time than I would have needed otherwise. Thank you for sharing and providing detailed explanations that helped me to "debug" my own implementation of what I learned here. Until now, I never heard of Dapper and have to agree that it really helps to simplify things without giving blind control to some framework. You have a new subscriber!
Glad it helped! Check out all my play lists. Also, this Path video may help you find the areas that can help you as you grow in C# - th-cam.com/video/LUv20QxXjfw/w-d-xo.html It is intended to help you assess where you are and the topics you need to add to your base skills. I hope it will help you fill in any gaps. My goal is to make becoming a developer easier and I hope I can help you be successful through your full journey!
This and your other tutorials as well are worth more than gold! Thank you for posting these videos on TH-cam for free :)) Maybe some day I'll buy your paid courses
Sir Tim for the first time i watched it was hard to understand , but from the second time that is when my eyes opened and understood what your intended to teach us .thanks!!!
Kombo: I had the EXACT same problem (Too much information to absorb at once). So i wrote up a 4 page summary of the entire video, which I am happy to share. Henry at PanatechComputer dot com
This is my first introduction to Dapper. I LOVE IT!!! I've used SQL for quite a while so I was excited to see a new way of connecting and querying a DB. I love learning new stuff, especially when it's explained so well :)
Thank you! People like you are important to this world. Sharing knowledge is the greatest gift one can give someone. We are drowning in information, but starved or knowledge.- John Naisbitt.
Awesome tutorial! I was expecting to spend at least 12 hours before hoping to get even close to this level of understanding. You taught it to me in 40 minutes! I ran this vid at 2X speed. You still sounded clear, and I was able to keep up. Woot! Subscribed.
No kidding. I've been binging your videos. I have this rule where I don't watch TH-cam videos longer than 15 minutes long. You are my exception. Keep going man! I appreciate you immensely.
I rarely sign in to TH-cam but I just had to thank you for creating these awesome videos... oh my gosh, you've helped me so much. I'm an experienced PHP programmer trying to switch languages, but the Microsoft world can be so intimidating and overly complex. Ugh. Thanks to you I feel like I'm going the right direction.
The first thing I did after wiring the sql connection and confirming that I'm pulling my list of people, I did a sql injection query into the last name field to pull person information with a ' OR 1=1 clause, so I'm glad you talked about sanitizing the input.
Loved it, very straightforward and easy to understand. You have no idea how much this video has helped me, not only with data access but with objects in general. Thank you so much!
As a Java programmer I am you my friend have quite the high quality pedagogic process here, I have found your videos way faster to catch on during my free time than the 8 daily hours invested during my masters here in France. Excellent Material and extremely clear Explanations. That also helps when you're a Spanish speaker cruising through English Material.
@@IAmTimCorey Nothing but the truth, I am an educator Myself, but in the CISCO stuff. Venezuelan IT Guy here. I use a lot more the resources you provide in your videos. I seriously find your material far more comprehensible and easier to put in practice than some material of the proffesors I met here in this MD. Keep rocking!
I have used Entity Framework for years and have never spent more than 10 minutes setting up objects and classes... and I even use it in Linux and have never had any problem with it! Great tutorial either way.
I guess I am just lucky I have never really done severely complex application with EF and haven't had the privilege of having to debug it...but, I get your point... valid concern.
I agree with that... things don't get fixed until someone complains about it! :) I remember a guy telling me during a code review one time saying that if it works the first time, there is probably something wrong (the moral being, don't stop there)
I'm a DBA trying to get more involved in C# and back-end dev work. This has really been helpful in trying to extend my SQL Server knowledge within a larger picture. Thanks!
Hi, just manage to get MySQL connected to my C# code, and made me understand some DataBinding stuff. Really like your style/speed/explanation! With some troubleshooting as it goes, to help use finds our own problem! Thanks for everything!
Thank you so much Tim! I always wanted to make more complex apps that would remember data from earlier sessions. I tried many ways to achieve it, but all of them failed somehow - it was just too complex. Then you came to my rescue and made everything look so easy. Thank you once again.
I honestly dislike verbose tutorials. But this is an exception (plus one whose channel I auto-subscribed). The way you explained those details are really important for .NET/MSFT-related development, especially given the putrid black magic and us often being gullible of the inner workings. Not only the helpful details, you also offer alternatives and practical techniques that helps software become more maintainable. This is really helpful, esp. for beginner software developers in C# / .NET. Can't recommend this channel enough - this guy is a great educator. Thank you for being in TH-cam and all your content. Heaven is counting your deeds. :)
Hi Tim, I've been following your videos for about a year since I wrote my first line of code. Thanks a lot, really, you have no idea how much help they've given. And I actually improved my English while learning C# ^_^.
Great tutorial! I used to work with Access and VB and I'm switching to SQL / C#. This video was very helpful. Just like your other video's the video and audio quality is perfect and your explanation is very clear! Good job!
I cannot believe you still reply up to this day even though this video was years ago. You were the best c# channel I've watched, I watched freecodecamp, and that bald one, but this channel was the way to go. I'm gonna plug your channel on every video on freecodecamp that I'll come across so they'll have a good c# teacher like you!
Thanks for the videos, your explanations and tutoring are really very thorough and informative. I know how much work it is to make these and appreciate the time and effort you put aside for doing this.
There is always more than one way to do almost anything, but when it comes to coding, and teaching coding for that matter, I usually find that the best way is the Tim Corey way. Everything is very well explained comprehensively in plain English so that stuff is learned rather than just mimicked and never really understood. Thanks Tim, you're a very generous and knowledgeable man.
Great tutorial. At first I thought it's a bit long, but the extra time you toked to explain everything was well worth it. It solved a lot of mysteries about getting and putting data in a Sql Database from C#. Thank you. PS: For those who need the source code for the [dbo].[People_Insert] procedure you can find it on Tim's website, down in the comments. Link: iamtimcorey.com/csharp-sql-data-access/
Yep, I rarely do short videos because I'm more interested in teaching you all about the subject, not just how to use it. Too often people learn just the how and not why or when, so they get lost or use the technique poorly. I try to avoid that.
Hi. This is a really great video. It explains a lot, in a short amount of time, and in a great way. I had to adapt my implementation of some of this code as I want to store the value returned by the Stored Procedure. In the end I used this: public int InsertRecuiter(string companyName) { string conString = Helper.connectionString("WorkDB"); string comString = "dbo.usp_Recruiter_Insert"; int returnValue = -1; using (SqlConnection con = new SqlConnection(conString)) { try { SqlCommand com = new SqlCommand(comString, con); com.CommandType = CommandType.StoredProcedure; SqlParameter param; // Add the input parameter param = com.Parameters.Add("@Company_Name", SqlDbType.VarChar, 50); param.Value = companyName; // Add the output parameter param = com.Parameters.Add("@ID_Recruiter", SqlDbType.Int); param.Direction = ParameterDirection.ReturnValue; // Open connection con.Open(); // Execute the command int rowsAffected = com.ExecuteNonQuery(); // Store the return value returnValue = (int)param.Value; } catch (Exception ex) { MessageBox.Show(ex.Message); } } return returnValue; }
Glad you got it to work. You can make your code simpler using Dapper if you want. Here is a video that shows you how to get those values out with fewer lines: th-cam.com/video/eKkh5Xm0OlU/w-d-xo.html
Tim, Been watching a few of your videos. Just a couple of comments on SQL Server. The "[]" are generated by SQL Server because SQL Server allows you to use a spaces in the object name. The only way SQL Sever can handle the space is by enclosing the object name in []. Second, I agree with don't rename the columns in the C# code. It would be much easier to create a view of the table with the bad column names and then use the view as the source in the stored procedure. That way SQL Server handles the translation and C# doesn't need to know about it. As for the videos they are great. You have a very good knack of explaining topics so that a novice like me can understand them and apply what I learn here to my real world tasks.
Another great tutorial I’ve watched from you. I love how you explain why we do things which has helped me further understand why we are doing why we are doing. Thank you
However I keep getting an error on the “ return ConfigurationManager.ConnectionStrings[name].ConnectionString; in the helper.cs class because it’s throwing an exception that it can’t contain text... I’m gonna have to rewatch and figure out what I did wrong :(
Thank you so much for these wonderful videos. It really helped me a lot. I'm gonna recommend this channel to all of my friends who want to learn c#. You really simplify topics, and I love that! Thank you, Sir.
great video. pleasant voice to listen to and excellent narration throughout every video i've watched from corey. if you're looking to brush up on development topics this channel is highly recommended.
Great work Tim! Great work!! Your videos are the best way to teach anybody without programming back ground, all concept are well explained... you the best Tim Cor. This video helped me a great deal.. Thank you
I'm gonna be honest here. You have the best format of transferring coding knowledge I've ever experienced. The way you simple things down, explain why you do everything, your clear/calm sounding voice, even the little 'pro tips' you throw in every video like explaining 'tab+tab' shortcuts, explaining what a "ThrowNewException()" does... Also, if I'm stuck with something in your videos you somehow magically know what I need to learn to understand the next step and refer me to one of you other videos that teach me things I need for the next step. I honestly can say I learned more in 2 weeks of watching your videos daily than several months at college. They just teach you stuff without really explaining the "why" behind it, so you end up googling it for yourself and spend a ton of time. Thanks for the free knowledge and keep up the good work!
I appreciate the kind words.
@@IAmTimCorey He's completely right. You, sir, are the best programming tutorial creator I've ever had the pleasure of learning from. I absolutely appreciate your hard work and dedication to enriching everyone's understanding. Thanks!
Yep, Tim's a treasure. Well, "treasure" may be be a bit flowery, but he's my go-to guy.
I second that
Literally the only tutorials I can follow, he actually knows what he is doing! Other people simply speed through everything and don't explain what they are doing...
You have no idea how much this video has helped me, not only with data access but with objects in general. Thank you so much!
Excellent! I'm glad it helped you out.
Good
Learned more in this one hour video than I did watching tons of videos and articles.
Best 60 mins ever spent. Thanks Tim.
Excellent!
Great step by step tutorial with extremely good presentation and explanations.
Helped a 63 year old 'newbie' to a much better understanding of C#.
I'm glad it was helpful to you.
@@IAmTimCorey Another old guy here to endorse your video! I've been doing this for over forty years, and it still surprises me how we all still stampede down the same roads, reinventing the wheel, year after year. The problem is, we rarely end up with anything better than we had before ... and quite often it's worse! Once an interface has been tested, debugged, and has been working for years, there'd better be a REALLY good reason to come up with a "better" solution. The problem with Microsoft over the years has been a culture of "this'll do" combined with a very short attention span. Just Google search accessing a database from a .NET program and see how many different flavors of access methods there are (ODBC, and so on). Your video introduced me to Dapper, and I think it's just the right blend of functionality and flexibility. Most of us just want to get our applications working well, with the minimum of effort. We want them to just run and run, year after year, with minimal drama. Something that works "most of the time" is pretty worthless, in the long run.
Thanks again Mate! A really nice, well structured instruction.
Tim Corey is the Bob Ross of coding!!!
I appreciate the kind words.
He doesn't make bugs... just happy accidents. :)
This is the best tutorial I have ever watched, seriously. I really feel like you are sitting right next to me explaining everything, even the things I know, but that just makes it better. Good stuff brother. Really good stuff.
0:00 - Intro
0:34 - Data base connection options: ADO, Entity Framework, Dapper
4:53 - Creating Demo Application: Win Forms
6:38 - Demo Database and Data Model
11:23 - Connection string: helper class
14:58 - Adding connection string
19:45 - Using connection string with helper class
22:25 - Recap
22:40 - Creating a UI form for displaying the data
25:24 - Wiring up the UI form: C# code design
30:24 - Wiring up the UI form: list box info
33:57 - Wiring up the UI form: data access from data base with Dapper
43:47 - Wiring up the UI form: debugging and list box bindings
50:05 - Wiring up the UI form: recap and notes on good practice for data access
51:57 - Stored procedures
58:05 - Explaining demo code so far
1:02:46 - Storing in data base: UI form design and wiring
1:08:26 - Storing in data base: C# code
1:15:08 - Storing in data base: Recap
1:16:04 - Summary and concluding remarks
Welcome to "C# Data Access" playlist.
nice
Thanks for blessing others with you efforts!
@@IAmTimCorey thank you for that as well!
awesome ... don't ever underestimate the way you communicate your learning, it is really powerful and comprehensive ... top job Tim
Thanks. Glad it is useful for you.
This might be the most perfectly paced long form tutorial I've seen
Thank you!
You're a God sent to students like me. I'm working on a School project and this may just be what I needed exactly. Thank you so much good sir. I've watched the whole thing.
I'm glad you found it helpful.
Dude, I've watched a lot of tutorials, and you're among the (if not THE) best I've seen. Very thorough, organized, efficient, and clear. Thank you for these, really great work!
Awesome! I'm glad you think so.
Leaving the listbox refresh debugging was downright awesome. You rarely get a chance to watch videos where everything doesn’t go perfectly - which never, ever happens in real life. Thx!
I am glad it was helpful.
Others have said it, I just want to reaffirm it, your teaching style is absolutely exceptional. I am greatly appreciative to have come across your video's, this video and another on building a SQL Database have helped me tremendously with a project I'm currently working on.
I'll be checking out some of your paid courses in the future as I need, I feel confident I'll get every penny's worth after learning from these well paced, well thought out, thorough but not overloading, free tutorials.
Thank you for sharing your knowledge in such a clear and comprehensive way! 👏
I appreciate the kind words and I am glad my content is helping you out.
We don't deserve a content creator like you.
Thanks for everything you've taught us so far!
You are most welcome. I am glad you have benefited from the content.
Thank you so much for the great content. I am progressing very quickly, and enjoy using my skills and watching the results.
Excellent!
I really can not understand why such an interesting channel like this has just 138K subscribers !! it should be at least 1M.
I appreciate the kind words.
this is awesome, literally over the top explanation. I cant thank you enough. i'm getting into database now, and this was extremely helpful. i already subscribed to you and will checkout your lessons. youtube is full of bad instructors and it is a bless to find people like you as it is very rare. in the past month I started learning MVVM, WPF and xaml and now sql with dapper. it is fun yet very challenging. hopefully it'll be rewarding. i'll surely watch and check most of your lessons regarding databases.
I'm glad you are enjoying my channel so much. There's a lot more to come.
I recommend Tim's intro to SQL course on his website; I watched this C# to SQL video, then took the course. When I came back to watch a second time, I understood the C# content on a much deeper level. Thanks Tim!
Thanks for the recommendation.
Really helpful tutorial very detailed only problem i had was "connection string" not working. So in "visual studio" I went to tools >connect to database and followed the wizard and after completion just copied the connection string from there and pasted in the APP. config file and did not get any errors after that.
I have same problem but i couldn't figure out how to solve it. here what i did int App.config file
but it is still not working. the Error saying >>>
System.Configuration.ConfigurationErrorsException: 'Configuration system failed to initialize'
@@abal6127 you're missing the providerName="System.Data.SqlClient" in your connection string. Is the way c# knows what type of SQL engine it has to use.
You have, hands down, the best tutorial series on C# on youtube !
Thank you!
TIm!! hi, its me again hehe im sorry to bother you. Im doing this tutorial, and i have come with a interesting question. Lets say that i want to add a Photo of the person that i seach in the text box. and display the photo on a picture box. Is there a way to store images into sql server and then talk to the database and get that image and put it into a picture box? Thank you for your time
There are a few options here, depending on your needs. You can store the image on your file server somewhere and just store the file path to the image in your SQL Server. That will greatly reduce your database size, especially if more than one row uses the same image. It will also make database backups much easier, since they will be a LOT smaller. The second option is to use the Varbinary(max) type. The third is to use the File Stream option. This last option is recommended for files over 1MB but if you decide to go that way, you add a lot of complications including the fact that you cannot use a SQL login to access the data. To undertake option two or three, check out the answer on this post: stackoverflow.com/questions/39354100/unable-to-insert-file-stream-into-sql-filetable-using-dapper-net
Thanks man!!
After a looking at a first video (Practical C# - Generics) , I delved into this one. I've been an SQL Server DBA and BI developer for years and, although being an absolute rookie with C#, this video makes everything crystal clear as you take the time to explain every step you take in the development of a new solution. So, thumbs up and a big thank you for the time and efforts you put in this learning material. By far the best and most addictive training material I've seen in years.
I am glad it was so clear and helpful.
I notice that you're using Microsoft SQL Server Management Studio for your database. Can I also do the same process but using wampserver/phpmyadmin?
Not with Microsoft SQL Server, but if you wanted to use MySQL then yes, you could. You would need to change your web.config's connection string to properly point to a MySQL server but otherwise it should work.
Tim, I am so grateful for this video. All of them really. But, this one and the Stored procedure vid has helped me a ton recently. I've been developing in C# for a few years now and have worked primarily with EF. Can't tell you how many times I've had some random issue with EF. Large and small. My final straw was trying to return stored procedure data to a Vue.js axios call. The SP worked fine on the SQL server side, but EF freaked out each time I requested the data using the stored procedure. (A frustrating error code if anyone is interested in seeing it) Finding this vid allowed me to quickly follow and connect with Dapper. Making my SP call supeeeeeeeeeeer easy. With EF I was constantly limited to building a View from the SQL side. Making everything really slow and cumbersome. Thank you for what you do. You've helped me improve my skills in more ways I can convey here.
I appreciate you sharing that. Thank is why I love doing this work
Even though it's 6 years old, I keep coming back to this video whenever I need a refresher. The way in which the concepts are presented is very thorough and easy to follow. I could like this video over and over again if possible.
Many thanks Tim.
I am glad it was helpful.
@IAmTimCorey i am suffering 2 questions as a normal programmer so could you please help me that and where can i contact with you? 😢🙏
Thanks!
Thank you!
just so you know, there are a lot of people out there that teaches C# and programming etc, you have a unique way of teaching that is easy to understand and a pleasure to watch, thanks for all the videos you put out there.Looking forward to keep learning from your videos.One more thing i like is, how you refer to your experience and approach to coding, like finding the easiest way to accomplish a task, many developers think that creating ultra complicated code makes them look smarter, nothing far from the truth. We should spent more time solving problems and less time memorizing complex syntax.I always go back to your videos to refresh some topics before I start coding, so again, great work and thank you for your effort creating this material.
I appreciate the kind words. I'm glad my content has been so helpful and clear.
I have an application administration background. Over the years I have written many custom scripts to pulling and merging data from the underlying databases to bypass and automate slow tedious and error prone UI activity. Your style resonates with me and is helping me break through some learning barriers I have with C# and migrating to command line scripts to creating tools with a GUI front end. Thank you.
I am glad it was helpful.
Tim, I have watched this video no less than 4 times from start to finish. It does such a wonderful job in explaining how Dapper works and what it does. I am already starting to use Dapper in a Model Railroading database app I am working on (I am retired). I will contact you at some point separately about something strange that VS is flagging as an Access limitation (CS0050 error) but I agree with you that Dapper is a super simple and powerful way to connect to a database. This video allowed me to take my learnings, change the methods, use a different database, yet get it working beautifully with Dapper to get data in and out. PS - I loved your SQL course, it was super detailed and super clear! Thanks :-)
I'm glad it was so helpful.
I used your string helper code as well! Put that into my app. I also think your naming of key columns makes a lot of sense. I used to definitively design my keys as "pkCustomer" for the primary iD and then "fkCustomer" for the foreign key, however because you name ALL primary keys "Id", when one is working with queries, it makes it so much easier to see which is the "One" and which is the "Many". I can tell that you probably migrated to this naming convention over time based on experience :-)
Ευχαριστούμε!
Thanks for spending you training time with Tim
I appreciate your support. Thanks!
I almost clicked off this video when you started talking about a package but, that really is an elegant implementation! Thank you for sharing!
You are welcome.
Tim Correy comes yet again, with another impressive teaching. Great Job
Wow, thanks!
Too much knowledge in just one channel. Thanks Tim.
You are welcome.
Hi Tim, I dropped a comment on one of your post on FB as directed, please respond to it. Thanks
I'm glad this video came up in my Google search. It's easy to follow and the pacing is perfect. Thanks to this video, I managed to finish up an application in much less time than I would have needed otherwise. Thank you for sharing and providing detailed explanations that helped me to "debug" my own implementation of what I learned here. Until now, I never heard of Dapper and have to agree that it really helps to simplify things without giving blind control to some framework. You have a new subscriber!
Glad it helped! Check out all my play lists. Also, this Path video may help you find the areas that can help you as you grow in C# - th-cam.com/video/LUv20QxXjfw/w-d-xo.html It is intended to help you assess where you are and the topics you need to add to your base skills. I hope it will help you fill in any gaps. My goal is to make becoming a developer easier and I hope I can help you be successful through your full journey!
This and your other tutorials as well are worth more than gold!
Thank you for posting these videos on TH-cam for free :))
Maybe some day I'll buy your paid courses
You are most welcome. Thanks for watching.
You are the best, I am very thankful to you, I got my pass to Master Course in C# and loving it. You are a wonderful teacher.
Thanks for sharing!
I appreciate the fact that you explain things slow enough for me to listen at 1-1.5x speed, depending on how quickly I need to learn this stuff!
I am glad it is helpful.
Sir Tim for the first time i watched it was hard to understand , but from the second time that is when my eyes opened and understood what your intended to teach us .thanks!!!
Great!
Kombo: I had the EXACT same problem (Too much information to absorb at once). So i wrote up a 4 page summary of the entire video, which I am happy to share. Henry at PanatechComputer dot com
Entity framework 60% percent of the time it works every time!!! Lol, great class man, you’ve got yourself a new subscriber.
Very glad to hear it! Welcome.
Brilliant video. Thanks so much Tim. Logve the way you cover everything in detail and don't assume pre-knowledge.
Thanks. I try hard to be thorough in my coverage.
This is my first introduction to Dapper. I LOVE IT!!! I've used SQL for quite a while so I was excited to see a new way of connecting and querying a DB. I love learning new stuff, especially when it's explained so well :)
Excellent! I am glad it was so helpful.
You could be one of the best teachers. Very clear. so helpful. Much information. Wow.
Thank you.
You are awesome! Not just the content, but your style! I feel like you're a long lost brother on this point! I Subbed. I'll be watching!
Thank you!
Thank you! People like you are important to this world.
Sharing knowledge is the greatest gift one can give someone.
We are drowning in information, but starved or knowledge.- John Naisbitt.
You are welcome.
This is the best tutorial I have ever watched, seriously
Thanks!
Awesome tutorial! I was expecting to spend at least 12 hours before hoping to get even close to this level of understanding. You taught it to me in 40 minutes! I ran this vid at 2X speed. You still sounded clear, and I was able to keep up. Woot! Subscribed.
Nice! I'm glad this video sped up your understanding so much. Now you have time to learn even more. ;-)
No kidding. I've been binging your videos. I have this rule where I don't watch TH-cam videos longer than 15 minutes long. You are my exception. Keep going man! I appreciate you immensely.
I rarely sign in to TH-cam but I just had to thank you for creating these awesome videos... oh my gosh, you've helped me so much. I'm an experienced PHP programmer trying to switch languages, but the Microsoft world can be so intimidating and overly complex. Ugh. Thanks to you I feel like I'm going the right direction.
Excellent! I am glad my videos helped you out.
Best long tutorial video i'v ever seen.... Thank you.
You're welcome!
Another well organized real world tutorial that at the end of it enhanced my knowledge base (without feeling confused about it)thank you!
You are welcome.
By far, one of the most comprehensive, detailed, and well explained tutorials I've seen in a long time. Great work!!!
I appreciate the kind words.
The first thing I did after wiring the sql connection and confirming that I'm pulling my list of people, I did a sql injection query into the last name field to pull person information with a ' OR 1=1 clause, so I'm glad you talked about sanitizing the input.
Yep, always good to check.
So glad I found your TH-cam channel. Excellent instructions, very easy to understand and great content. Keep up the good work. God bless you.
Welcome aboard!
OMG!, Huge eye opener. Thank you so much for explaining how to connect C# to SQL (the easy way)
Awesome!
Loved it, very straightforward and easy to understand. You have no idea how much this video has helped me, not only with data access but with objects in general. Thank you so much!
I am glad it was so helpful.
As a Java programmer I am you my friend have quite the high quality pedagogic process here, I have found your videos way faster to catch on during my free time than the 8 daily hours invested during my masters here in France. Excellent Material and extremely clear Explanations. That also helps when you're a Spanish speaker cruising through English Material.
I appreciate the kind words.
@@IAmTimCorey Nothing but the truth, I am an educator Myself, but in the CISCO stuff. Venezuelan IT Guy here. I use a lot more the resources you provide in your videos. I seriously find your material far more comprehensible and easier to put in practice than some material of the proffesors I met here in this MD. Keep rocking!
I have used Entity Framework for years and have never spent more than 10 minutes setting up objects and classes... and I even use it in Linux and have never had any problem with it! Great tutorial either way.
I guess I am just lucky I have never really done severely complex application with EF and haven't had the privilege of having to debug it...but, I get your point... valid concern.
I agree with that... things don't get fixed until someone complains about it! :) I remember a guy telling me during a code review one time saying that if it works the first time, there is probably something wrong (the moral being, don't stop there)
I wouldn't call it dissent, I think maybe I just spoke too hastily. ;) I will pay more attention next time.
I'm a DBA trying to get more involved in C# and back-end dev work. This has really been helpful in trying to extend my SQL Server knowledge within a larger picture. Thanks!
Excellent!
Hi, just manage to get MySQL connected to my C# code, and made me understand some DataBinding stuff.
Really like your style/speed/explanation! With some troubleshooting as it goes, to help use finds our own problem!
Thanks for everything!
I am glad you enjoyed it and congratulations on getting MySQL to work with your C# code.
Thank you so much Tim! I always wanted to make more complex apps that would remember data from earlier sessions. I tried many ways to achieve it, but all of them failed somehow - it was just too complex.
Then you came to my rescue and made everything look so easy.
Thank you once again.
I'm glad I could help.
You are born to be a teacher.
Thank you!
Excellent explanation on how C# works with SQL and Dapper.
Thank you!
I honestly dislike verbose tutorials. But this is an exception (plus one whose channel I auto-subscribed).
The way you explained those details are really important for .NET/MSFT-related development, especially given the putrid black magic and us often being gullible of the inner workings. Not only the helpful details, you also offer alternatives and practical techniques that helps software become more maintainable.
This is really helpful, esp. for beginner software developers in C# / .NET. Can't recommend this channel enough - this guy is a great educator.
Thank you for being in TH-cam and all your content. Heaven is counting your deeds. :)
I appreciate the kind words.
I'm just a beginner. Well explained and easy and clear. Thank you Tim Corey.
Please consider viewing my video to help you plan your learning path - th-cam.com/video/LUv20QxXjfw/w-d-xo.html
@@IAmTimCorey Sure... Thank you.
Great video, watched the whole thing start to finish. Will be creating a project tomorrow.
Thanks for growing your skills with Tim
Hi Tim, I've been following your videos for about a year since I wrote my first line of code. Thanks a lot, really, you have no idea how much help they've given.
And I actually improved my English while learning C# ^_^.
Awesome! I'm glad my content has been so helpful.
Gee , thank the Lord for Tim Corey. for demystifying this world of SQL database connection for us beginners
Glad to help.
The most comprehensive video I've seen on this subject matter. Thank you so much for the video and your help Tim!
You are welcome.
Great topic. You have shown me a much better and cleaner way to interact with SQL Server with C#
Excellent!
Great tutorial! I used to work with Access and VB and I'm switching to SQL / C#. This video was very helpful. Just like your other video's the video and audio quality is perfect and your explanation is very clear! Good job!
U R the Best C# Programmer Man, My God Protect U
Thank you!
I cannot believe you still reply up to this day even though this video was years ago.
You were the best c# channel I've watched, I watched freecodecamp, and that bald one, but this channel was the way to go. I'm gonna plug your channel on every video on freecodecamp that I'll come across so they'll have a good c# teacher like you!
I appreciate the support.
Thanks for the videos, your explanations and tutoring are really very thorough and informative. I know how much work it is to make these and appreciate the time and effort you put aside for doing this.
There is always more than one way to do almost anything, but when it comes to coding, and teaching coding for that matter, I usually find that the best way is the Tim Corey way. Everything is very well explained comprehensively in plain English so that stuff is learned rather than just mimicked and never really understood. Thanks Tim, you're a very generous and knowledgeable man.
I appreciate the kind words. I am glad my content has been so helpful.
Really good video, thanks for the help
Usually I don't comment on tutorials but this one really did everything right :D
Thank you!
Timmy you have over done yourself on this ... it is excellent
Thanks!
Just a small thing ... 6 years ago when you made that video, dapper had 2.54m downloads. As of today, its 237m! Amazing
Awesome!
An indispensable guide, like every video on your channel, thanks Tim.
You are most welcome. Thanks for watching.
Thought this would be tough but after this video everything is super clear. Thanks a lot!
You are welcome.
This training video is very helpful and your training and teaching method is practical and impactful. Thanks!
Thank you.
I cant stop watching tim's videos
👍
Highest quality tutorial I've view thus far
Thanks!
Great tutorial. At first I thought it's a bit long, but the extra time you toked to explain everything was well worth it. It solved a lot of mysteries about getting and putting data in a Sql Database from C#. Thank you.
PS: For those who need the source code for the [dbo].[People_Insert] procedure you can find it on Tim's website, down in the comments.
Link: iamtimcorey.com/csharp-sql-data-access/
Yep, I rarely do short videos because I'm more interested in teaching you all about the subject, not just how to use it. Too often people learn just the how and not why or when, so they get lost or use the technique poorly. I try to avoid that.
@@IAmTimCorey It looks like the link for the dbo.people_insert is not working. is there any way you can provide that?
Another crystal clear, informative and interesting video. Thank you.
You are welcome.
Thanks Tim!
I *finally* feel somewhat comfortable around connectionstrings now :)
Great!
Super clean, sticking to the core and yet elegant. Thank you so much!
You are welcome.
I already know how to do this and am commenting for youtube algorithm. Thanks for your hard work!
Thank you!
We've started using Dapper on some of our .NET projects and this video was a good inspiration.
Awesome!
Excellent and straight to the point. Thank you Mr. Corey!
You are most welcome. Thanks for watching.
Hi. This is a really great video. It explains a lot, in a short amount of time, and in a great way. I had to adapt my implementation of some of this code as I want to store the value returned by the Stored Procedure. In the end I used this:
public int InsertRecuiter(string companyName)
{
string conString = Helper.connectionString("WorkDB");
string comString = "dbo.usp_Recruiter_Insert";
int returnValue = -1;
using (SqlConnection con = new SqlConnection(conString))
{
try
{
SqlCommand com = new SqlCommand(comString, con);
com.CommandType = CommandType.StoredProcedure;
SqlParameter param;
// Add the input parameter
param = com.Parameters.Add("@Company_Name", SqlDbType.VarChar, 50);
param.Value = companyName;
// Add the output parameter
param = com.Parameters.Add("@ID_Recruiter", SqlDbType.Int);
param.Direction = ParameterDirection.ReturnValue;
// Open connection
con.Open();
// Execute the command
int rowsAffected = com.ExecuteNonQuery();
// Store the return value
returnValue = (int)param.Value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
return returnValue;
}
Glad you got it to work. You can make your code simpler using Dapper if you want. Here is a video that shows you how to get those values out with fewer lines: th-cam.com/video/eKkh5Xm0OlU/w-d-xo.html
Once again a fantastic tutorial. Really loving Dapper.
Thank you!
Kudos for pronouncing SQL correctly!
lol thanks, but I'm not sure there is one correct way. Both are acceptable (es queue ell and sequel).
@@IAmTimCorey , as far as I remember both ways are accepted now but the creators originally wanted it to be pronounced as "sequel"
Tim,
Been watching a few of your videos. Just a couple of comments on SQL Server. The "[]" are generated by SQL Server because SQL Server allows you to use a spaces in the object name. The only way SQL Sever can handle the space is by enclosing the object name in []. Second, I agree with don't rename the columns in the C# code. It would be much easier to create a view of the table with the bad column names and then use the view as the source in the stored procedure. That way SQL Server handles the translation and C# doesn't need to know about it. As for the videos they are great. You have a very good knack of explaining topics so that a novice like me can understand them and apply what I learn here to my real world tasks.
Thanks for sharing.
You're a wonderful teacher.
Thank you! 😃
I've tried all steps on mac and everything runs well. Use Docker + Azure Data Studio + VS. Thanks Tim.
You are welcome.
The Dapper tip... so good - thx!
You're so welcome!
Another great tutorial I’ve watched from you. I love how you explain why we do things which has helped me further understand why we are doing why we are doing. Thank you
However I keep getting an error on the “ return ConfigurationManager.ConnectionStrings[name].ConnectionString; in the helper.cs class because it’s throwing an exception that it can’t contain text... I’m gonna have to rewatch and figure out what I did wrong :(
This is a great opportunity to improve your debugging skills.
Thank you so much for these wonderful videos. It really helped me a lot. I'm gonna recommend this channel to all of my friends who want to learn c#. You really simplify topics, and I love that! Thank you, Sir.
Excellent! Thank you!
great video. pleasant voice to listen to and excellent narration throughout every video i've watched from corey. if you're looking to brush up on development topics this channel is highly recommended.
Thanks for the recommendation.
Thanks!
Great work Tim! Great work!! Your videos are the best way to teach anybody without programming back ground, all concept are well explained... you the best Tim Cor. This video helped me a great deal.. Thank you
Thanks for such a great review. I appreciate it and I'm glad you got such value out of my content.
Thank you for this video and for all your work. You make the world better place.
Thanks, I know Tim and the team really appreciate that.