connect mysql to visual studio 2022

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I am going to discuss what how to connect my SQL to visual studio 2022 so first we are opening the workbench my SQL workbench and here you can see root is the user localhost server and password 3383 port3306 now let's give you the password so this is connected here then after you can see secure database and this is all there now the next is opening Visual Studio 2022 so thereafter let's click on this great new present you can create the projector for here Windows application or console application so console that's this one selecting after that click on this next if you want then you can change the name meaningful name and here make sure you need to use your dotted framework 4.8 after that let's click on this create then the next is here this is the toolbox or dragging or one button and before I'm doing or recording things so right click on this project then go on this manage nerdkit and this place you need to search here my asker so my SQL here you can see you need to install MySQL data 68 million or previously downloaded this one this is here eight point this version and or this is your latest and if you want then you can check or take the uh here or a different person also after that next is click on this install so this is now doing some or download as well as strong here dot transform 4.8 that selected and for this one internet must be connected and this is now attempted to character dependencies now let's click on this OK accept so here you can see so many packages now gone there system data and this all that's come there now this part that has done that install after that let's click on this or close double click on this button control and this place you need to or use here testing the code okay so this is here the code now you can see all this place this name space that's not required so here you can see button on the button click event or there or here or when you click this delete that execute and this place that display here the records so if I run this code then here when I click button then you can see here or this is connected and here recorded display so one by one this uh reading the rows and displaying all the rows one by one so 3 is 0 so 3 row starts display now let's stop that and here this code is too simple you can see you can write manually so button right click here you can write MySQL or connection so con here come on then reader and this is now a string path so you need to keep the part or Twitter source that is localhost server name initial database you need to give uid wrote and give the password after that SQL connection you can write the query so select start from as secure.ct so this is now selecting the city table records if I go on there then if I write here select a store from secular dot City now if I run this here you can see circular.city or record this display here the same thing or when execute query then that display then after connection bias connection try and if that all correct here this code connect try block current then or this return to the result and if that not correct then this here not returned that cash by the court block covered by the catch block okay and here you can message dots so here you can give four so if you give your two so that's just removing total is now three days there so if you give your tool so that display here only two rows so here sorry two columns that are data that display if I run this then you can see this places only two rows that display if I click on here you can see one two click on OK or here to Alpha three so only two rows or two column data that display so now let's understand this code so MySQL connection is used to open the connection MySQL command is yours so um or database and here MySQL this is used to read the data one by one from the mySQL database table and this here you need to give the path of the files so here server database user and the password unity game then after string then you can write any query select a start from and here con so this is the new MySQL connection is there so this is the Constructor and here you can see the path uh path that's come there after that try this is open either connection or CMD the s curl command so this is now execute the command and here two parameter is current call so SK that's come there next is Con after that this is now executing the or CMT so executing and trading and then after here wired here dot read so one by one that read the data if the data is present on this stable then the condition is true else first so total ordering and here on access dot so to get get values so first here you can see get the values of specific columns so zero index columns First Column and next is there is the space and here next column that display so First Column second column that display if one by one read all this all then here after that close the Dr so here is now this object is the Ops they empty that close and contact close and after that that odd form try and that's now displaying the data and here you need to use so this name space MySQL current because this all that's come under MySQL client and here Windows Form this answer record because message box form that's come there and system this also that's for event arcs okay and let's run one more time so when I click button then click your name find first and second row status display so first and second so first and second so first here two or rows and here or next is above this is another so only two columns selected this places because or this place I have given only two this place I have given only two okay so you should write this or code then you can directly use on your editor and this is the way we can connect here my SQL with visual s20 2022 so I hope guys this video is still helpful for you so like this video it's over so thanks for watching see you next week thank you
Info
Channel: C Plus+
Views: 5,296
Rating: undefined out of 5
Keywords: mysql, visual studio, vs, microsoft
Id: I43-hM3m03I
Channel Id: undefined
Length: 8min 45sec (525 seconds)
Published: Fri Aug 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.