HOW TO ADD, UPDATE, DELETE USING C# + MSSQL DATABASE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
good day everyone welcome to cape cod okay guys update okay so it don't start position nothing give me nothing center screen at your size now for nothing give me nothing 10 24 and should be nothing 400 or 600 yen and then size 10 and and then you form border style you're going to hang fix single and then as you know nothing tone form 1 text control box false yeah flat formula [Music] okay nothing so give me nothing yeah then it's not view okay and then um button no parasa add new okay and hand um number number and then employee id the capital nothing employee id last name and then first name needle name okay address so yeah [Music] all cells okay all cells see all cells nothing lahat mali banditas address gaming tongue [Music] okay okay so now it's new item and then form window forms so yeah so windows start position yes enter and then you size calibriolet then size 10 okay then you form border style give me nothing fix single and then [Music] another background color giving that on that thing deep sky blue and then again employee foreign okay first name address or you middle name middle name una okay and then address contact okay so ad entire name text box value uh indesign okay so id last name first name middle name then you address given nothing multi-line and thing [Music] details close button data so it does nothing right and so naming employee id okay then txt last name txt first name then txt address or middle name txt address and untxt contact then pattern and update and then beat the end concept at young adding close beta and close okay so it turns up six seven eight nine yeah okay and then so double click nothing to add new then f that show dialog okay then click nothing tongue double click nothing tone button [Music] i think table starting database okay so now datum database c-sharp tutorial so a tiny table table employee id so doing nothing along then i think primary primary key and then last name first name middle name okay address and you contact then save so name nothing channel tbl employees okay 10 [Music] okay and then it's string con equals nothing connection string not then then return code okay i think database and then can play on camera 10 i microsoft sql server name database nathan database c-sharp tutorial yeah that's connection okay so ethernet string data sql client okay and then given anti-variable data scl connection on sql command cmd along equals to new connection db okay then data soft so formula 10 con equals to new sql connection then db that okay that get connection get connection close ux message and then so warning message button that okay message icon that warning yeah okay so dito [Music] if validation lang no if the xt employeeid.txt equals equals to null or txt last name the text equals equal to null or txt first name that text equals equals null or txt address the text equals equals to null and then in txt contact and equals equals to null and then data maglogeta now message box dot show so required uh missing field and then it's each number then message button that okay the message icon that information and then temporary return and so cmd equals to new sql command and then your connection not then again insert into table employee employees you name nam uh table nathan this is a database and then you attribute okay fields employee id okay employee id last name first name middle name okay then address values data so give me nothing parameter no time parameters okay yeah and then data cmd that parameters that add with value okay then data you name now adding text box employee id last name first name middle name address so details last name first name middle name address and then your contact okay parameters text box nothing so that first name txt middle name txt address okay txt contact and then cmd dot execute none query okay para execute you data atma doing so so new employee has been successfully saved okay and then message button that okay message box that icon that information so private void so nothing clear then txt employee that clear okay after nothing clear automatic um my text box nothing txt last name that clear takes the first name that clear the xd needle name okay but the xd address and then txt uh contact and then data in bottom save nothing give me nothing enable okay the position button update so disable nothing message box foreign save the database yeah so data retire add new and and then until example 2021-001 okay uh uh come on okay then contact numbers in nine three five one two three four three six seven eight okay that and then save okay new employee has been successfully saved okay so now clear then okay view atom record nothing details a database okay so what i don't know uh methods method nothing public void loads i mean nothing load records yeah okay add monetize and reference data using system.data.sqlclient variable.net connection sql connection con sel command cmd then sql data reader dr hon equals the new sql and then in db that sorry that gap connection cyan employees okay employees yeah okay then dgv that rows that clear so i equals number nine rows okay and then so connection open and then connection that close yeah so sql comma cmd equals the new sql command and then adding connection okay so select all from dbl name not then dbl employees and then you adding dr or data reader equals to cmd dot execute reader yeah then you will not a while plus and then dgb employees that rows that add and so determine database that to stream comma okay so happiness and then last name then first name middle name and then address you contact noted foreign [Music] [Music] uh yeah and then f okay then d turn around this dot f equals to f okay okay now record grid view now um [Music] okay so unbuttoned btn save okay so a new form okay f that btn sabian enable equals to true then f that btn update and that enable equals to false yeah okay then [Music] one then start and so try nothing okay so employee id 2021-002 and then address has been successfully saved okay and then close summer natalia ditton new record okay so far okay so this is a data grid view so edit columns nothing called icons so it's another atom edit and then you adding delete okay delete and okay then you name your i call delete okay so nothing at this function and let's double click the detail is variable string call name equals to bgb employees that columns okay e dot column index that value that name that name okay and then if tainan if statement if call name okay call name equals equals to call edit and you name them [Music] text box name nothing f so i'm gonna tie now form to that f equals to new form two no do nothing in the display so form two you acting value data starting data grid view and then display nothing data's a longer text box nothing's happened to okay this then f the txt employee id that text equals to the employees rows e that rows index okay that sells that value that to stream same did nothing so happy nothing last name first name middle name address and then new contact so nothing last name uh first name uh middle name okay then address contact two three four five and six and then txt and f the txt employee id that enable false and then button up f dot f that beat the end save that enable equals to false then f that bt and update that enable equals to true so the update and then f that show dialogue same time young adding say button right disable now update nothing sorry now function new adding update and so on that open source and then con dot open okay don't gone that close and if message box that show one to update this record okay and then another message okay then message box button that yes no no para then message box icon dot question equals equals to dialog result that yes i think function new sql command so update tbl employees set okay you adding last name okay equals to at last name go at a parameter first name first name equals to add first name then middle name equals to add middle name address equals to address okay then contact equals to a contact where employee id request to add employee employee id so yeah then again attendee to nam add new adding connection then so cmd that parameters that add with value add employee id and then you name now textbox not tena txt that text okay so copy them nothing last name first name middle name address contact 13 i think last name first name uh middle name address daniel contact match don't parameter nathan text last name txt first name txt middle name address and daniel i think at cmd dot execute none query okay [Music] message box so written along message box so employee has been successfully updated go and then middle name coming from m then update want to update this record i can and then again number zero nine five one two three four two three and then update want to update this record yes employee has been successfully updated contact number foreign message box that show okay i want to delete this record and then a message box button that yes no and then message box icon that question equals equals to dialog result that yes think function cone open then con dot close and then cmd equals the new sql command then delete delete from tbl employee you name the table not then employees were okay were employee id equals to okay equals to dgv that rows okay then e that rows index that sells one so want to say young employee id nothing index not then that value that to string okay then cmd dot execute and query a message box that show [Music] okay record has been successfully deleted yen and then a sage then message button that okay then message icon that information and then data load records so yeah delete function okay so try nothing so click on delete icon want to delete this record yes okay so run it nothing did it mark yes so record has been successfully deleted okay then walana young record me mark so a dial 2020 okay zero zero uh 3 and then again okay and then your address key boom boom santa maria bulacan contact number zero nine one two three okay one two three then save [Music] foreign okay clear so 20 21 0 0 4 okay then ramirez danielito middle name yeah i okay then uh companga 0.211 and then you adding delete once you delete this record yes record has been successfully deleted so so after young adding add update and delete now using c sharp so hang on tun along guys so don't forget to subscribe and hit narrator notification bell para update video don't forget to like this video see you on next video bye bye
Info
Channel: Just a Minute
Views: 5,093
Rating: undefined out of 5
Keywords: csharp, asp.net, asp, .net, how to add using c#, how to update using c#, how to delete using c#, csharp tutorial, learn c#, c#, c# programming, c# tutorial
Id: foLxfiVSo6c
Channel Id: undefined
Length: 63min 39sec (3819 seconds)
Published: Mon May 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.