VB.Net with SQL. Insert, Update, Delete, Search (CRUD) in VB.Net with SQL Server. Source Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to my channel so if not all good concept of c-sharp programming with SQL Server database available in this channel Salaam see this link in the description box below this tutorial is insert update delete charts I mean complete crude operation in maybe dotnet for beginners you if you don't my channel yet please subscribe and press the bell icon for upcoming videos start Visual Studio okay now new project like a new project Visual Basic windows exponential basic windows into small application just to name the application my application name is Kru tutorial project and select the location my location is DJ be redundant project you toriel folder select the folder be dotnet project tutorial select and then click OK my project is created ok now I just know I'm just designing the form back color and the back color with lime okay this teacher is insert update delete and charge season vb.net it's also covered how to use different types of control type welcome works and ready were too far from crude operation in that case first of all I'm going to design this form with level textbox combo box and ready button controller good concept of c-sharp programming with SQL Server database available in this channel Salam see this link in the description box below okay the first level is for tidal crude tutorial form font sizes aiding and for color is white now I'm gonna take another control level control this level control for ID the text is ID and design this level control as well in the form with level textbox combo box Teddy button and button controls okay for color is but okay which white okay now ID coffee this level control and I'm gonna take five level control for ID name address age and City six level control okay now ID second level control is for the name Tech students to the text okay name address city is and sex may look you know okay now text text box the textbooks one is for ID the font size since the font size font size is ten twelve were told yes okay 12 font sizes 12 okay now ID coffee this text box that was cool name that grows three address and take looks poor for ease and CD I'll mention this path specifics it in that case I am gonna adding combo box change the font size this combo box as well twelve okay twelve is a big tennis okay and it's fine now the CD I'm just adding item comma box item item is a New York Washington Ireland Chicago Los Angeles and then ever okay now this is the combo box of style change this is style drop down drop another stylist job down waist okay now now we can now it's not allowed to write any text ok now sex ready button one for the world true and font size 10 okay now it's looking fine text is Mel ready button one text is Mel and ready written true for FEMA okay now add button control this button control for insert to perform insert aberration text is 8 and font size is tan on world true okay and for color white moon height highlight and back color is just now sir I'm fine okay in this click event I will write code to insert record in the database this is my database I am just adding connection if you have muted SQL Server database just add connection now I'm going to create database my server name is in database server and database name is Kru tutorial DB ok my database is created expand this database and Xfinity but there is no table now I'm going to create in a table my ID column name is ID integer type name and worker address and worker CD and were 250 okey enough and each and were 50 and sex also and work Oh ages float type because it's number address okay now the table name is user info tab click on OK Motum a table is created now I'm gonna inserting record in the instable it'll be stable in that case first of all I'm gonna declaring the textbox deme ID as integer that IDs integer types of integer like x1 dot txt and name is string text box to door text I am just declaring some variable I can look at the control text box ID we'll take that tag books one controls data as same as name address city city as stinging combo box yes CD from you'll come from combo box and name is as string string or no no sorry dim explode that so it's double name as as double tack with food or text and last one is sex sex s yes it's a bit complex because there's a to control ready button one and ready button too so he played he wouldn't want the check equal to truth then sex will be ready when a sex will come from ready button one ready button one is for Mel and ready button true for female so if readable in wondered checked then Mel its I mean if not checked then female okay after that now if you if you understand that the insert button click events code you can easily you can easily perform update delete jars everything all the operation from the dead and they will be stable I related to database table okay team query as a string insert into user info tab values will be ID name address city is and sex okay we have six column in the database table ID name address CD age sex now I just know I just heard their query SQL query now I'm just connecting with database using conical desk and actually in that case you should dim poor sister at SQL client using Khan as SQL connection equal to new SQL connection my connection is to get the connection just see like the de River database yes select database and go to the property this is the connection listing just drag it yes this is the can just select the connection string and see that the initial catalogue crude tutorial diamond it if his name just coffee this connection listing and it's very easy just a fist it in a SQL connection then if you connect character this project database will be connectively due to project ok now using CMD command as SQL command equal to new SQL command my SQL command is query but as I still what I have to ok query khones connection connection them okay now same leader parameter dot added value value is added of ID and the variable is ID and name is from name variable this is the global variable name at third of name is global variable and then name ok address he is also sorry city city and then is finally sex sexy sex okay now it's done see that ID name address city is and that that of ID name address city is as like both we finally see a muted parameter dot edit value' ID name address is that have sex okay now finally open the connection Condor open and CMD dot execute on K hundred that we must you at execute non-quality insert update delete operation under close finally message box no chapter problem in the first after successfully far from this operation it will display the masses message box not show successfully I did okay now just debug yes ID 100 name settle on swift okay address New York New York USA City New York is 35 ml sexes man you can say its lack of a successfully a did yes successfully added so to build a there yes 100 name address says all over the recorder and started successfully okay now I'm gonna reading him math word adding method to bein dead in dead a good view now I just added but it's not displayed in Stanley so I'm just a math or I and I insert it will display the data grid view okay just gonna drag datagridview and dropping you from okay now private sub binder the queen is sting equal to select star from my table name is user info tab underscore type user in front of school tip now using SQL connection so it is in con as a SQL connection equal to new SQL connection just coffee the connection is string from the insert button click event just copy yes you can copy it from the property this paste yes the connection is created now come on using CMD as SQL command sorry SQL command equal to new SQL command my command is query select Esther from user input up you can write Queen a select star from user in for time instead of query okay now one is using their now-dead adapter existing ba as SQL dated after okay then now using DT datatable named if he can read a little fennel L don't is dead and did people using VT as new daredevil be a dot feel DT finally that I could be hundred asserts equal to DT okay damn it's finished now just call this math work in there button one click event yes this is the button or click event just call this method and there is bind data okay now just debug yes insert another record one zero one named John address Chicago USA and City Chicago 36 Mel had successfully added yes Oh what problem to displaying data feel select common property has not been initialized before calling field before calling till amassed initialized the common property in that case just write this simple code first of all stop debugging and then after that adapter the year dot select come on D equal to CMD just all right okay now it's done now do not have any problem went back okay now this debug again and add and the record one through three name Christina address Atlanta and city I'd learned the USA CD Atlanta and age twenty-five three Moliere successfully added yes yes the recorder displaying standard datagridview and with all the records okay now it's done now coffee the parent control and copy/paste I'll use this button going to get Deadeye according to the ID in that case just change the text of this button control gat and double click go to that click event button to click event in this button I'll just write clearly for display the data embedding weeb you according to the ID user user ID only the info tab team ID as integer tigrex wand or text then I'm just declare variable ID for tax box warmed or text and and query as string select star from user info tab you know in front of school depth fire ID equal to at the rectified okay I just declared world variable using corn as SQL connection equal to new SQL connection my SQL connection is yes just coffee disconnection from the TBS control just yes the connection is done the connection is created okay now come on tags in CMD as SQL command equal to new SQL command ask your comment is a query come goodies select a stem user input of an ID equal that the party and Connor's connection string okay now using da s s new SQL dead adapter okay anything okay now da dot select command equal to CMD you must initialize that come on is in DT as new data table the adult film TV finally it will display the data in dedicate view that case if DT dot Rose dot count I mean if I D have for input the ID text box if there is a record in the database table according to the ID then it will display I cut else it will not display any record so if B T dot Rose dot count greater than zero then text books to dot text equal to DT dot roles zero row index zero zero index and then on his column index and the column index zero is ID so zero one dot two a string it's if if there is no record then the textbox to dot text equal to blank okay now just I'm just testing with one text box only i own the name then I will share with all the text box okay now yes put ID ID name address city a sex okay everything is against me now just a food ID one hundred and click on get yes oh no no no no no no no mas declared a scalar variable at that video sorry I declared as I used this color believer but I don't complete the declaration so just at the CM v dot forbidden dirt a do it mellow scalable evil ID and the variable is ID noted there sometime I keep their error so that you can understand how and you face any error how to solve this l instantly okay you know one hundred get yes it's displaying the name safety based on ID 100 okay now addresses table 3 CD combo box and age take this for sex male female likes radio button okay now just text box to text box 3 that works three row index that looks for tigress 3 and textbooks for Tegra 3 row index is 2 around is 0 and column index to run this 0 column index 3 textbook spore oh yes that looks 2 3 & 4 record exist display the record and if ripe or not exist then it will display the it will plank that text box okay now vamos cantar tax equal to DT Rho 2 Rho 0 for da testing okay good and for type of sport dot txt equal to DT dot roll 0 5.2 stream and finally radio button sex sex now if DT dot Rose 0 and column index 6 dot twisting equal to Mel if the records in the terribly stable is Mel Mel then it will checked they're ready button one if not Mel I mean if female then it will check the ready button to ml for female ready version 2 dot checked equal to true okay now just debug yes this is the records now just debug go to 100 get oh column cannot find column 6 oh sorry I just a mistake took the index a 1 2 3 0 ID 0 name is 1 index one addresses index to cities index 3 is index for sex is index oh yes yes in that case ayats can find the column in the six so I have to write if I the quarter 1 and X 2 the 1 2 3 4 sorry calm water the CDs three and a as is PO sex is five yes yes yes sorry it's just mistake yes now it's done okay you see that ID name and address city is sex yes it's working and sex is male already written one is checked and then if one routine get yes fistina sex is female as everything is displaying based on the ID you can assign textbook direct instead of scalar variable in that case what you should do you just change the syntax anti-cult our text box here single quotation double quotation and ampersand just right there textbook swan dot text if you write this code here then no need to declare variable I just turn delete this s color variable and the variable as well okay now debug again okay just test 100 get yes it's working without scalar variables and variable and directly you can use direct text box in squealing okay now copy the button control to perform update operation just change the text of this pattern control update go to the click event yes to perform update operation the code is a bit similar come as due to similarity of code I just coffee it from add button this is very similar if you understand inside button code you can perform update delete and of all operation okay now as I am just to change the code higher should change abilities and for tab set just change the command greeting set ID no ID because ID will be in close name equal to 1/3 of name address equal to a date of address seed equal to at the root of C D and the e equal to at the rate of peace and sex equal to 1/3 of sex I are now at condition Phi R ID equal to at the rate of ID yes ok now see this query name address city age sex and wisdom ID name address city else X all the fun CMD dragon including and just think change the master successfully updated instead of circle Eadie okay now it's done just departed see that now ID it will update name address city age sex it's allowed to change never disappear sex based on ID because ID is primary primary column now I'm John John oblong okay now just we can update just successfully updated we're sorry I didn't change the masses that's why okay the name is updating John oblong okay when I update operation update operation is done now coffee this pattern control and test this button control I will use for performing delayed operation just change the texture delete okay now delete is a bit confidential so things the back color of this little button red yes delete go to the click event yes in this event just coffee I already told you that if you for for if you understand insert operation you can far from delete updates there's all aversion to delayed no need to and the variable just IDs enough so I just removing all variable except ID column ID variable successful in deleted message will be changed successfully needed and oh yes and I updated update button I forget to change the message okay now I'm gonna change that query queries delete user info tip instead of object enough because I will perform the delete operation in the in this burden so delayed either in foot up ir ID equal to at the root of ID just very simple go to the bar form load event and call the method so that you can get data at at running and debugging first time instant okay yes it's loaded now 100 get yes this is the record you can delete it just delay just successfully delete it and record also there from the dead I give you
Info
Channel: Swift Learn
Views: 28,667
Rating: 4.9030304 out of 5
Keywords: swift learn, crud in vb.net, crud operations in vb.net, vb net insert update delete, insert, visual basic .net (programming language), vb.net tutorial for beginner, sql server, how to, insert update delete, vb.net crud sql server, vb.net crud, visual studio code, insert update delete in vb.net, crud, crud in vb.net with sql, vb.net crud operation, visual basic for beginners, insert update delete in vb.net sql, insert update delete in vb.net using sql server
Id: k1KDo7O0Tzs
Channel Id: undefined
Length: 28min 58sec (1738 seconds)
Published: Sat Nov 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.