MySQL VB.NET Tutorial 18 : Checkbox , radiobutton and groupbox with Database

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome once again in this video I'm going to show you how to use radio button and check boxes and group boxes with your Visual Basic Windows Form application and mySQL database so I will give you an example so I have in my database uh in this video series I have been showing you that I have in my myfield database database called database and the table name called e data and in this table I have shown you how to save data uh in this table so I have shown you how to save data in the column employee ID name surname and age right so employee ID name surname and age and suppose I want to add one more column data for gender now so this is the new column data I want to enter and I want to enter the data on the basis of the radio button selected by the user so let me show you what I want to Implement so I want to take a radio button from my toolbox so I will search for the radio button radio button one and radio button two and this radio button will represent the gender of the employee so I will change the text of this radio button as radio [Music] button for male this should be male and the r button for females okay I'll write Fe female and I will also change the text on the name of this radio button as radio button female and radio button male okay now what I want is let me run the program and I want to show you the behavior of these radio buttons so when what when I select this male here and when I select this female You observe the behavior of the radio button I can only select only one option out of two radio button at a time so this is uh the behavior of radio button and I also want to show one more thing which is the group box control and suppose I will take some radio button here also inside the group box so just take a group box and take two more radio button inside the group box and take two check boxes also in this group box right it's one checkbox and two checkbox and now when I run the program you see here when I select these radio button only one of them is selected and in the group box also when I select one radio button in the group box this out of these two radio boxes only one radio button is selected but this does not have any effect on these radio button so in any group box so your form is also a group box so in this form group box you can add a radio button and you can only select one radio button at a time in the form if you don't use group box or otherwise uh include them in the group box okay and when I select these checkboxes You observe that you can select multiple checkboxes at a time so this is the basic difference between radio button and checkboxes that you can select SE only one option at a time from the radio button but you can select multiple options using check boxes now to the implementation part I will just delete this group box for now and what you want to do is for example I want to save the data clicking this button so for now just select this mail ready button and double click it and go at the top at this top and where you have this public class form two declared and we are going to declare one more variable here called [Music] dim gender as string okay and this is our Global variable which will contain the gender of the employee and just copy this gender and once again go to this male ready button and double click it and just write gender is equal to and the double code just write male and same thing do for the Fe female radio button just double click and just write gender which is your string variable and just write here female which is like this okay okay now what you want to do is in the video number six of this series I have shown you how to save the data into the database using the save button so now I have one more column to add so earlier I was showing employee ID name surname and age how to save them and now I have one more field to save which is gender so in here this all code will remain same if and if you don't know this code just go to the video number six and just see what I have done there and in this in this uh code I just need to change one query here so one one line of code here I will change this query variable so just write insert into Data Base do e dat which is my database name do my table name and in the bracket I have written employee ID name surname and age which are these column title of the my skill database now I want to add one more column which is gender so I will write here comma gender and then write outside this bracket just write value and make one more bracket and I have written I have given the text box text of the text boxes so these text boxes whatever user enter uh the data in these text boxes it was coming here right so I have the text box for uh the employee ID name surname and age and at the last just go at the last of this code here and you just need to just give this gender variable here so just give comma before this bracket right just this give this comma then this double quote and in between just give this and sign and in between just give the variable name which you have declared above which is gender so just copy this gender from here and the save button and the query down just paste at the last here so now your query looks like this insert insert into database. e dat which is my table name and in the bracket just write that column name for employee the name surname age and new column we have added as gender and outside this bracket just write value and in the bracket just give the text which you are getting from the text boxes for employee ID name Sur name and age and we have added one more field called gender here right and now when you run the program and let me open my database table also so right now I have employee ID up to 15 I want to add employee ID 16 for example so I will give here 16 some name some Sur name name and age and for example the employee is a male and I save click the save button my data is saved and when I refresh my database you can see here this gender field is also filled now now for example I want to add one more employee which is a female so some name some surname and the age and she is a female and I save the data in the database and I refresh my database and you can see here the gender is now female so in this way you can re use radio button with your visual Basics Windows Form application and MyQ database I hope you have enjoyed this video please rate comment and subscribe
Info
Channel: ProgrammingKnowledge
Views: 92,912
Rating: undefined out of 5
Keywords: Combo Box, Text Box, Visual Basic .NET (Programming Language), Visual Basic (Programming Language), Database (File Format Genre), MySQL (Software), Tutorial (Industry), Software (Musical Album), Deleting, VB.NET, .NET Framework (Programming Language), Microsoft Visual Studio (Software), Radio Button, Checkbox
Id: zy_pGgC7hj8
Channel Id: undefined
Length: 9min 45sec (585 seconds)
Published: Sat Mar 29 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.