C# Tutorial 25 C# Databases
Вставка
- Опубліковано 27 сер 2024
- Get the Code Here : goo.gl/rTFqTe
Best C# Book : amzn.to/2iMArkU
Support my videos on Patreon : / derekbanas
This C# Tutorial is going to cover a lot in a short video. I'll set up the newest SQL Server and Visual Studio 2017. I'll then explore Creating Tables, Using SSMS, App.config, Connecting to SQL Server with C# and a whole lot more.
For best results take notes on the cheat sheet provided above as you watch and leave any questions you have.
Thank you to Patreon supporters like the following for helping me make this video
cottageindustriesbuild/
jaryd remillard : instagram: @distant_admiration
bugreplay.com
@kyleaisho
@thetwistedhat
vjFaLk
github.com/Yea...
tradeterminal.io/
Derek Banas is probably the most searched thing in my UA-cam search history..
They're just too good..
Thank you for the nice compliment, but I think PewDiePie beats me by a bit :)
@@derekbanas Haha, I don't think so..
Just blasted through this series in order to prep for job searching and wanted to say thanks. One of the best tutorial series I've seen, wish you were making videos when I was in college!
Thank you very much 😁 I wish you the best on your job search
I always read your name as Derek Bananas. #1 tutorials imo.
I loved all of the C# tutorials in these series! Everything is explained in a fun and understandable way, suitable for beginners.
you are a friggin life saver. Thank you for walking through the database connection and everything. Its so different than in the book I'm learning C# from...probably because they are working with visual studio 2012 in that book. Thank you so much
I'm very happy I could be of help :)
Derek ... just reading some of the comments. One viewer suggested you slow down. Please do not slow down.. If they want something slower there are already too many slow tutorials. The speed is one of the things that makes your tutorials stand out from the rest.
Thank you :) Don't worry I won't make slow tutorials. I'm the only fast tutorial guy on UA-cam and I like being different.
I will be frequenting this channel a lot in the coming years....
Thank you :) I'm glad it helps
WHY i dont have app.config ? i created new broject on sql database template and do everything till the poin i have to open app.config .. i have no items in properties and in references i have the one only that i added (system.configuration , sytem.core ... adn so on )
I really enjoy the way you pace these tutorials, very informative and concise. Thank you for the great videos!
Thank you for the compliment :) I do my best
Thanks, Derek! I learnt so much throughout the series, you're my go-to recommendation for all things code.
Thank you for the nice compliment :) I'm happy to know I've helped
Derek, I love you
please make more !I would love to learn more about mvvm and different ways of communicating between usercontrols and windows..
There is no reference folder in solution explorer in VS219. Do I need to start a specific project to see references?
Try using a C# Console app Project. It worked for me in VS 2017
Thanks for the fantastic guides so far Derek! I've been waiting for this one in particular! Very relevant topic for me.
I'm glad it helps :) I did my best to cover a lot in this video
Thanks a lot Derek Banas.
Hope we will get more of such videos.
I'm happy you liked it :)
I dont have references in my solution explorer
when creating the console app, check the box that buts the solution and project in the same folder
@@reeds7777 I did this and still have no References. I also don't have app.config
If anyone cannot find the references list, you must create a Windows Form. He never bothers to point that out.
I used a new C# console project, and that worked, for me. I first tried using the same project that I used for tutorial 24, but a Program.cs didn't exist, and creating one didn't work, because then I had two conflicting starting points...so don't do that.
Love your work. Would have liked to have seen soemthing on entity framework and binding that to controls, ie some real world database apps where the underlying tables have been normalised. Most examples are so trivial they are not that helpful. Anyway really liked your series, you are sharp and too the point, no waffle, clear sound and pictures. Can't recommend you enough.
Thank you :) Sorry I couldn't cover more at this time. I can always come back.
When I create a new database, I don't see any server name. When I enter manually random = error. What's wrong?
Hi, everything is fine and working. I had some problems because I'm using Visual Studio 2017. I had to install the SQL database 2016 and after that the "SSMS-Setup-ENU". But everything is working. Fine. Thanks for this tutorial
DBS Rock. This is perfect timing as I'm just taking a database course. Thanks a bunch!
I'm very happy to help :)
what will be the coverage of #26 tutorial? :D
Nothing! :D :D
Thanks for taking the time to make and upload your videos - much appreciated. P.s. it makes me smile how you sound just a little like Joe Swanson.
Thank you for the nice message :) It is my pleasure to make the videos
if you put your local sql server there and then get the .exe file of the program, which i'll use on a different computer, will it still work? i just need to locally save data to the computer, on which the program is running.
Could you do tutorial on TCP/UDP Networking?
I'll see what I can do
Cool, will you also include ability for multiple clients to connect?
what you are looking for are sockets
Could you provide any link to some good networking (TCP/IP) tutorial?
I really need that too!
thumbs Up!
Amazing tutorial as always. Hope you can do SSIS and SSRS too. Thanks a lot again.
Thank you :) I plan on doing more
How to insert something into the table ?
it would be cool if you would also make a video about debugging of C# and JS code when using Visual Studio and a browser, that would be a very useful topic :)
Derek ... I have to say that I am impressed with your wide range of knowledge. I have been a software developer for 15 + years. Specializing in client/server apps with PowerBuilder and Oracle. I recently decided that I have to expand my skill set so I started to focus on web development. I have been watching a lot of tutorials on various things such as javascript, PHP etc etc. I found that most of the tutorials are to slow and lack the energy or enthusiasm that I see in your tutorials. I gotta ask how did you obtain such a wide range of knowledge? Are you a software developer by trade and what do you specialize in specifically? Also are you familiar with PowerBuilder?
Thank you for the compliment :) I've worked as a developer since 94. I worked for universities, Apple, IBM, and for marketing and financial services companies. I guess the main reason why I used so many different types of technologies is because I've worked constantly with universities, while helping students with their personal projects. For the last 8 or more years I've mainly focused on running online stores and making mobile apps for medium sized businesses. Sorry I haven't used PowerBuilder.
hey man, thank you for the tutorial. I was wondering tho, how can you share this program to run on another computer if the connectionString includes your personal laptop info. How can I change it to take into account any other computer ?
Hey Derek,what checkbox do i have to check for your c#tutorial and do i need to install visual studio 2017 community ?
Sorry, but I'm not sure what checkbox you are referring to? I would recommend VS Community 2017 because it is great and also free
My project is on Daewoo transport management system ....but i'm confuse in selecting the attributes.... guide me
Sorry, but I don't have access to that
You'd think this sort of stuff would be more widely taught
Might also be a good idea to do MongoDB since their library is pretty easy to use.
Visual Studio 2017 just allowed for connecting to DBs. I'll see if it is easy to setup MongoDB. MySQL doesn't work yet because Oracle is slow.
I have to honest though...I never could work with dB's all day long though, they will eventually drive you crazy.
Can you make an updated video about this?
I’m going to make an updated C# course starting in 2 weeks
Everything went as planned, I didn't get any errors and I did everything like in the video but the console is empty for me... I have no idea where to even begin to change the code because there isn't any errors, it's just not printing anything (besides giving the ReadLine)
Is C# playlist ended here?
I find these database connections to be kind of tricky. When I connect to a database I usually follow this steps:
Connect manually using the server explorer up in view.
I make a connection string field and all that in a static class, that I just use
Make a dbml visual class, in which I can see the database and how the tables relate
Make a class and use a datacontext with some methods that modifies and re-opens the connection based on the connection string.
Although that dbml is great, as a beginner I don't know which approach is a better practice, can someone help out ?
Also I heard a lot about using Entity for connections
great videos sir !
I really appreciate all of your efforts doing such things like these.
May I know if u already did some tutorial about J2EE?
thank you so much sir !
Thank you very much :) I have a 100+ video series on Java, but I haven't covered JEE in detail yet
Good tutorial but i have some problem with the provider it doesn't exist in the file App.config.
I wrote it manually and make save but it's surround a mistake with the variable string provider and can't launch the project.
Have you a recommendation please !
Thanks
Hi Derek. PDF quads to x,y coords required some rotated space codes in JavaScript , do you have any idea how to code it in VB or C# ? Maybe JSO (Java Scrip Object) may help ?
Great video Derek!
Are you going to do a part 2 of this video?
The video came just in time, as I'm doing a project at university where a database could come in handy, but we need to be able to let a user write new rows to an existing table. Is that just as easy as it is to do a ReadLine from a row?
Kind regards.
Thank you :) I'm working on the next one. Yes you can send any query like I demonstrated here to write rows.
Sounds great. Do you have any ETA? :-)
To make a new row from the C# code, how would you do it? Let's say I want to add a new product. Could you provide me with a short example/code snippet?
Hi Derek,
I follow all the instructions but in "Add Reference" I don't have System.Configuration.
By the way, I wrote all the script exactly the same and I get that exception when I run the program:
System.ArgumentException: 'The specified invariant name 'System.Data.SqlClient' wasn't found in the list of registered .NET Data Providers.'
Are these two things connected?
Thank you for your reply and for your excellent work with yours tutos ;)
how can you deploy that into a working offline application? tutorial please
I have a question my id isnt auto updating when i add new data to the table, and to me it seems like its setup right
Hi Derek!
Great Tutorial. And it would even be greater if you could demonstrate how to talk to an elasticsearch HTTP interface ;)
Is there a builtin 'provider' already for that or would it be required to code my own lib that performs HTTP requests(blocking, non-blocking if that is possible at all with some sort of event handler, ...) to a port 9200?
Furthermore, it would be highly appreciated if you could just demo how to retrieve data from a table and place it into a form row by row(with paging), and clicking on a row opens up another window (to show how to handle multiple windows in an app) with data from another table where related items exist, e.g. show all customers, clicking on a customer opens up a new window and shows all offers for that particular customer - or as you would implement it 'show all animals, and then show all the sounds that they make' ;)
Thanks!
i worked entityframework to connect SQL . but now i want connect to server and store my document at server, not local database. what should i do ?
thnaks.
Its waaayyy too complicated!! My question is, after configuring all properly, if I compile and share the final fb application, lets say, a database application, will the end user need to reconfigure all of this? Because Im thinking his computer will not have a database, and all the connection keys will be diferent...
Thanks a lot again for awesome tutorials
Thank you for watching them :)
It didn't show adding the primary key to the table.
Thank you for your hard work Derek :)
I'm very happy to help :)
Windows 10/8 Only: SQL Server 2015, 2016 Windows 10 Only: SQL Server 2017
i can not connect , i already copied . the sever was not found
I closed the window that you see at 2:38 is there way to reopen it?
Have you found any new quirks in 2017?
It is way less buggy then 2015
Got a little stuck in the tutorial. I'm extremely new to SQL but not new to C#. At 5:30 in the video, you say to add a reference to System.Configuration. Not only do I not have a References dropdown at all, when I click on Add Reference, literally nothing pops up. I thought maybe it was a missing NuGet package, so I installed the ConfigurationManager package, but nothing changed. However, System.Configuration is in my SDK folder under my dependencies.
Not really entirely sure what to do about this one. Kinda stumped. Any help is greatly appreciated.
Have you seen this stackoverflow.com/questions/6740744/cant-add-a-reference-to-my-project-it-simply-doesnt-detect-it
I hadn't, but after looking at it, I did some more research. The most I have is .NET Core 2.0 - so I went and installed the .NET 4.7.2 Framework and this is still all I've got when I go to edit the Target Framework:
gyazo.com/2385b17ee8396fbdebe3470a86c7421a
I also did unload the .csproj file and attempt to change the Target Framework that way but that broke it entirely, so I'm.. back to square one. :(
4.7.1 * my mistake. Mistyped. :P
Oh my god, I got it. I realized (albeit after a ****load of trial/error and googling) that I was making the project itself in the .NET Core Console Applications instead of the Windows Classic Desktop Console Application, which let me change the framework AND let me add the System.Configuration reference.
God, that was a hassle. Wouldn't have figured it out without your help, back to the tutorial I go - which is incredibly helpful by the way. Thanks so much.
I'm happy you fixed it and that you're finding the tutorial useful :)
OK thanks Derek
Where is the App.config file in VS 2017?
Why black background color? Distance beetween 0 (level background black color) and about 130 (grey color of letters) is only about 130. This level of contrast is bad, except for young people. Distance between white background and black color (black letters) is 255. Letters on black background in Visual Studio are gray.
thank you very much for this video !!!
I'm very happy to be of help :)
Thanks for the tutorials.
You're very welcome :)
Awesome video, thanks for the help
Thank you very much :)
I watched alot of your c# tutorials... do you have any for serial com port communication?...
Hello Derek thanks for the best tutorials. kindly can u suggest good books we can use to enhance our skills more and what do you advise us to keep up with coding?
Hello Ali, The book I recommend in the descriptions for each of my videos is the book students tell me best covers that specific topic.
Cool thanks do you have a LinkedIn account
Yes, but I never use it
600k subs congratz :)
Thank you very much :) That is kind of amazing!
You should also create a website where you can store and do "small" tutorials. :)
Sorry, but I don't know what you mean by that. I have a website
ThinkTank... Is that your website?
Oh it is... nevermind lol... I thought it was a shared website with multiple youtubers :)
Your tutorials are so good.. Any plan to do tutorials on ASP.NET Core?
Thank you :) Yes I hope to cover ASP soon
So happy to hear!
Thanks bro. It is useful
I'm happy I could help :)
I have an SSD drive for drive C: for fast boot ups but it has limited space. When I installed VS2015, I did not see an option for changing what drive it installed on and it used up a lot of space on the C drive. Anybody know how to change it to install only on the D drive?
I don't know about VS 2015, but VS 2017, which is what I use, allows you to decide where you install
Thank you
Happy to help :)
Congo Derek for 600k subs.!Is it sufficient to learn n follow ur tuts or study 1500 pages book ??
Thank you :) I'm covering just about everything covered in a 1,000 page book and more
You can't have it both ways. If you say DAT - A, then it is a DAT - A - Base. If you say DATE - A, then it is a DATE - A - Base. CHOOSE ONE!
But, I like both
It was very helpful
Thank you very much :) I'm happy you enjoyed it
thank you for these helpful tutorials.
I have Q. does 2016 Microsoft server work with 2017 visual studio?
I'm glad you liked them and yes you can use 2016 SQLServer
What’s the difference between developer vs express?
If i'm not mistaken developer has all features, but you can only use for development practice and if you want to deploy to use it in business setting you need to upgrade to paid version. SQL express you can use in business setting, but you have feature limitations and storage limitation. MS website has all comparisons laid out, but I can't remember where exactly
Hello Derek!
i need a advice from you. I am 19 years old and nowadays i am "working" with php, because this is the language that is use at my job (this is my first job) and well, i can say is my favoriate language actually (with JS), so I trying to learn lavarel framework.. Now i think i need to pick a "hard" language to get better jobs. What languange recommend you to learn better? Java or C#? I have seen them both, but i need a good recommendation from an expert like you!
in terms of database, i like MySQL (i use SQLyog) but i think too i need to learn use a database more "heavy", like Oracle or SQL Server maybe?
Sorry for english! Good luck from Dominican Republic!
Hello Ivan, The best advice I can give you is to reach out to people local to you that work for the company you want to work for. They will tell you exactly what to focus on. There is no solid answer for your question because some corporations use completely different languages and frameworks. I personally love Laravel, but it isn't an in demand framework used by businesses where I live. That may be completely different for you. I hope that helps :)
thank you, it's really helpful 😁
Happy I could help :)
You are an amazing person.
Thank you for the kind compliment :)
The sound on this series seems a little bit low. I'm having to turn up my speakers almost all the way to hear you. Could you increase the volume?
Sorry about that. I can't effect the video after it has been uploaded sadly
@@derekbanas that makes sense. I guess re-uploading the videos is out of the question?
Is this a local database?
Yes
Man i freakin love you
Entity Framework plz
I'll see what I can do
Hi Derek!
i have a question please
do you want to continue this tutorial or this is the end????
I'm working on the next part using Unity and Xamarin, but it isn't easy to transition immediately. I hope to start soon
Hi Derek !
Your c# tutorial came to the end,but I still have a problem and can't figure out what to do.I have a great opportunity to be part of a big programming company,but as a test,i have to build a speedometer app in xamarin. And I don't know where to start,because I don't know Xamarin .If it is possible,please help...with anything,even a single word-advice because I don't want to miss this chance.
I am very thankful for you tutorials and would be very thankful :)
oh i forgot to tell you the most interesting part: i only have 2 weeks...
My C# tutorial isn't over. You'll need to use the Accelerometer for that. Here is some info developer.xamarin.com/recipes/android/os_device_resources/accelerometer/get_accelerometer_readings/
Yes thanks a lot,i have done that infact,but i don't know how to use the Accelerometer's data to get length or to find the speed at all...
can i use sqlite inside an android app?
Yes ua-cam.com/video/WLoy_rz12SM/v-deo.html
Great Tutorial!! Unfortunately when I want to add a reference there is no DBTest (In my case a different name) in the list. For me it shows Solution 'The name I have chosen' (0 projects). The symbol in front of this text is a symbol of Visual Studio. Due to that I can't select program.cs and app.config either. Can you/anyone help me to fix this problem?
Having same problem.... :(
Figured it out at 3:51 .... need to add new item = "C# class" and copy the code from that timestamp.
More!!
I'm continuing C# tutorials with my new Unity videos
Thanks!!!
Should I rather learn C# or C/C++?
I already can read Python (Never really coded anything except for a calculator)
I already can do stuff using HTML + CSS
I can code with JS with a lot of time and googling.
I want to be able to do Machine Learning, AI and Chat bots.
I also want to be a fullstack web developer in the future.
Which language would help me to get into Swift more easily.
Which language gives me the best fundamentals and understanding for other languages?
So should I learn C and then after it C++, skip or C or should I only learn C#? Are there better options for me? I'm willing to take a challenge.
I'd learn a language that you can do the most with. C# is great for desktop, mobile, web and game development. Accord is a great C# framework for machine learning. C++ is for programming on the hardware level. It sounds like you're still an intermediate programmer. I'm not big on telling people to start with C, or C++ because you just can't easily make anything interesting. Programming especially for beginners should be fun in my opinion. I hope that helps :)
.vex[E] If you want to go into Machine learning and AI, focus on Maths. Maths will also improve your programming logic massively as just knowing the syntax of a language doesn't really help when you want to build something but it's too complex to think about
Derek Banas I always thought you can do everything with C++. Like Drivers, OS including Programms. And isn't that right that I can do very fast Programms that run with C++ and Python? I have also some 3D modeling skills and OpenGL is written in C++. I guess there are a lot of options to implement an AI.
But which language helps me the most to understand how other languages are working.
Faizan Abbas Do I have to have a broad knowledge of math or just a Part of it? I currently have a honors course in math aimed at mechanical engineering.
.vex[E] Statistics, Differential Equations and Matrix Algebra come to mind. You can look up the maths you need online, or ask your teacher to find out for you. Honestly, don't go too in depth, just take it a step at a time. There's a free machine learning course by Andrew Ng online (one of the greater minds in the field), start there. I think he explains any math encountered during the course
The coding went by a little quickly for me. I'll probably have to watch it again.
can i follow this whole series with using xamarin on mac? or are there some things you just can't do with xamarin? for the rest love the series :D
Yes everything up until part 25 because you need SQL Server
ah nice thanks for the anwser! then i will get started soon with the series ^^ would SQL lite be a good alternative instead of sql server?
I'll see what I can do with Xamarin
DBs Rock -- Hey, I'm not the only any more :-)
Thank you for doing that :)
hi derek...when is the next c# video going to be released....thanks!
Hi, I think next Saturday. On Wednesday I'll upload Learn F# in One Video
hi. do you have any plan to start asp.net mvc tutorial after ending c# tutorial?
Yes it is on the list
Could you do tutorial on TCP/UDP Networking?
"DB's Rock", am I alone with this comment Derek?? ;)
I love working with DBs, but I agree that I could not only do that work
Nice video
Thank you :)
Can you make a Qt in one video or a Qt series?
I'll see what I can do
Thanks for the video!!!
You're very welcome :)
It s exactly before the lab where we learn this so thanks for a great overview Derek !
Hello derek, can you please provide us with some game development tutorials
I'm going to start them very soon
wanna thank you for python tutorials and eagerly waiting for those game development tutorials
my SQL server connect does give me a server name, why not?
i have the same problem
have you solved it?
you may need to install sql server again or try to get to the information at 2:06. The information under admin is very important. I pasted that into the server in Microsoft sql manager and ti worked. It should also appear in visual studios when you connect to the database as well. My server name was SQLEXPRESS I am not sure why derek banas had his own name for his server. That worked for me and I was able to finish the rest of the tutorial.