Entity Framework - Insert Update and Delete in C#

Sdílet
Vložit
  • čas přidán 26. 07. 2024
  • Entity Framework - Insert Update and Delete in C# Using SQL Server
    In this tutorial, we have discussed how to implement CRUD Operations Insert Update Delete and Select in Entity Framework Using C# and SQL Server.
    Discussed Points :
    - CRUD Operation Using C# Entity Framework
    - Entity Framework Datagridview Binding
    📂 GitHub Repository
    ► goo.gl/hzeWVT
    💖 Buy me a Coffee
    ➤ bit.ly/3L36ut4 (PayPal)
    ➤ bit.ly/3VF0iPT (Razorpay)
    🌀 Related Videos
    goo.gl/VPHZ4h : C# CRUD Using ADO.Net
    goo.gl/ySUFf8 : Similar Mvc Tutorials
    goo.gl/3ajHuA : Similar C# Video Tutorials
    🔗 Find me in
    Udemy : bit.ly/3RtyQSB
    Facebook : / codaffection
    GitHub : github.com/codaffection
    Discord : / discord
    Twitter : / codaffection
    #WinForm #WindowsForm #CodAffection

Komentáře • 179

  • @CodAffection
    @CodAffection  Před 6 lety

    goo.gl/RFY5C2 : Subscribe to CodAffection
    goo.gl/SUi4bg : Login Window in C# Using SQL Server
    goo.gl/zV892S : C# CRUD Operations With SQL Server
    goo.gl/bPcyXW : Buy me a Coffee

    • @khushbujoshi7356
      @khushbujoshi7356 Před 4 lety

      your skill talents shows everything...your speech is too good.don't think too much on that.keep it up.👍👍👍

  • @Brianseb
    @Brianseb Před 2 lety +1

    Gracias Maestro, 5 años tiene el video y sos el único que en todo internet que sabe enseñar como hacer un Update en Entity.

  • @valeriusmegamozg
    @valeriusmegamozg Před 5 lety +11

    It's a very helpful video! Thank you very much, you've just closed all points in 30 minutes much better than my lecturer in 1 week. Thank you!

  • @2005Azm
    @2005Azm Před 6 lety +1

    Such a elegance in your code sir ! Clean , and clear, complexity made simple !

  • @nsh8255004
    @nsh8255004 Před 4 lety

    it was super perfect tutorial. waiting more from you. thanks alot.

  • @christosioannou7359
    @christosioannou7359 Před 4 lety

    Best video ever seriously!!!
    THank you very much

  • @ga7853
    @ga7853 Před 4 lety +3

    Thank you so much, that was so clear and understood, I appreciate your efforts for making this great video, Thanks again

  • @PabloPellegrini
    @PabloPellegrini Před 5 lety

    Perfect explication!! Thank you from Argentina! ♥

  • @edvardpotapenko
    @edvardpotapenko Před 5 lety

    Thank you very much, that was very helpful!

  • @ThumbIKR
    @ThumbIKR Před 5 lety +1

    Owwww, really great tutorial sir, thanks :)

  • @samsamry9179
    @samsamry9179 Před 3 lety +3

    Superb one,
    Really worked very well and made easier
    I'm looking forward to seeing search btton function additionally

  • @user-gu3kj6gy8q
    @user-gu3kj6gy8q Před 5 lety +1

    Oh man! Thank you very much for this tutorial. Sorry of my english. I'm from Russia)

  • @kavindutharaka2273
    @kavindutharaka2273 Před 5 lety +1

    very clear explanation. Thank you very much.

  • @tjensen529
    @tjensen529 Před 5 lety

    Excellent video. Thanks much!

  • @khizerhussain8313
    @khizerhussain8313 Před 2 lety +1

    Very Helpful Video! Thank You

  • @KL-gc2hx
    @KL-gc2hx Před 3 lety

    Thank you very much! Learn a lot from your video!

  • @blazept567
    @blazept567 Před 6 lety

    Thank you very much, Sir!

  • @abadd0n297
    @abadd0n297 Před 4 lety

    Who's the man? You're the man! :D

  • @alikemalkulful
    @alikemalkulful Před 2 lety

    Perfect explanation. Very clear, Thanks a lot

  • @skillshared3249
    @skillshared3249 Před 3 lety

    Thank you so much. This is great tutorial.

  • @INDIANSinghX
    @INDIANSinghX Před 3 lety

    Dude u did great job ,thanks a lot dear

  • @bejanniku
    @bejanniku Před 5 lety

    Dude, your English is perfect. But that TABL instead of table really cracks me up! good work tho

  • @alirezakazemi5318
    @alirezakazemi5318 Před 4 lety

    This was very easy to follow and practical. Thanks so much!

  • @johnsimbe991
    @johnsimbe991 Před 6 lety

    Helpful video, thank u sir!

  • @robertmcdonough1084
    @robertmcdonough1084 Před 5 lety

    Awesome video! This helped me so much

  • @Gus-px7hd
    @Gus-px7hd Před 5 lety

    Very useful, Thank you.

  • @shifasvn3256
    @shifasvn3256 Před 2 lety

    you helped me to begin my learning of winforms and i have learned it in one day.i have 2 years experience in .net core and entity framework.this helped me to posses knowledge about winforms ,it was necessary for me because the new company which i got a new offer needed winforms.

  • @masumkazi9137
    @masumkazi9137 Před 3 lety

    It was so helpful!! Thank you very much. Much appreciated.

  • @osempo
    @osempo Před 4 lety

    Cool video, easy to follow.

  • @cholemoore5733
    @cholemoore5733 Před 6 lety

    Thanks. Great video! Well explained. Only wish that I found this video earlier for my assignment.

  • @talithasouza1298
    @talithasouza1298 Před 3 lety

    simples e muito bom, ajuda muito

  • @mrgonzolla
    @mrgonzolla Před 5 lety

    Thank you for this video. I found it very helpful!

  • @hajerjalloul7311
    @hajerjalloul7311 Před 6 lety +2

    good !! it's helpful

  • @mscamarade3413
    @mscamarade3413 Před 4 lety

    Thanks, very mach! Very useful video

  • @UBOINIK_TanksBlitz
    @UBOINIK_TanksBlitz Před 3 lety

    Большое спасибо! Ваше видео очень помогло мне!

  • @fabiofocking382
    @fabiofocking382 Před 4 lety

    Wonderfull, this video save my projetc! thank you for this tutorial.

  • @PalashBansal
    @PalashBansal Před 4 lety +1

    very concise and to the point. Thanks :)

  • @whopawan8384
    @whopawan8384 Před 4 lety

    Thanks, Man very helpful

  • @mikolajsemeniuk8574
    @mikolajsemeniuk8574 Před 3 lety

    Very helpful !

  • @tohidulislam5041
    @tohidulislam5041 Před 2 lety

    I use C# winform for 7 years and used parameterized query and never tried EF of fear of learning. After seeing this video all fears gone and feel interested on it. From now for my new project I will try to use EF.

  • @TIAGO543211
    @TIAGO543211 Před 4 lety

    this channel is the better one, im not even a fluent english speaker but i understand better than people teaching from my own country, i really appreciate your channel bro!!

  • @mustaphaELHOURA
    @mustaphaELHOURA Před rokem

    very helpful thank you so much

  • @waqarahmadqureshi6948
    @waqarahmadqureshi6948 Před 2 lety +1

    thankyou... its helpful

  • @ga7853
    @ga7853 Před 5 lety

    Thank you so much for this wonderful efforts, and thank you again for the source code, you have made easy for us. Grateful.

  • @mjkl614
    @mjkl614 Před 6 lety

    I can hear chicken clucking in the background, you must woke up real early and made these videos, great job, keep up the good work!

  • @tusharkantidas4622
    @tusharkantidas4622 Před 4 lety

    Awesome job sir...

  • @manojrathore85
    @manojrathore85 Před 2 lety

    Excellent video

  • @traderasapassion7760
    @traderasapassion7760 Před 3 lety

    It's really helpful

  • @KhalidAfridi1
    @KhalidAfridi1 Před 2 lety

    Thumbs Up bro. Excellent explanation of CRUD operation of using Entity Framework. You saved a lot of my time. Thanks

  • @theethicalh3707
    @theethicalh3707 Před 4 lety

    thank you very much bro

  • @humayunnasir6261
    @humayunnasir6261 Před 5 lety

    VERY GOOD VIDEO THANKS ALOT

  • @user-pw9mp6uk1t
    @user-pw9mp6uk1t Před měsícem +1

    Thank You.

  • @stevenyaga
    @stevenyaga Před 4 lety

    Very very helpful video

  •  Před 5 lety

    thanks very much Ad

  • @rafaelramos8220
    @rafaelramos8220 Před 5 lety

    That was a good video, I'm coming back to code world and it helped me a lot.

  • @atakantekoglu5520
    @atakantekoglu5520 Před 4 lety

    Thank you very much. It is so educational for me. You are a very brilliant instructor. Keep going!

    • @CodAffection
      @CodAffection  Před 4 lety +1

      Thanks for your wonderful feedback. let me know your topic suggestion for future tutorials.

    • @atakantekoglu5520
      @atakantekoglu5520 Před 4 lety

      @@CodAffection Nowadays, I try to learn .Net MVC. Maybe, you can focus on it and also, it is better to create full blog project or etc. with MVC. Thank you.

  • @nelpro
    @nelpro Před 5 lety

    Bro, you're the best!

  • @NavaneethaKrishnanA
    @NavaneethaKrishnanA Před 4 lety

    Thank you.

  • @ronaldkiefer3565
    @ronaldkiefer3565 Před 5 lety

    Boom Thanks video tutorial was very helpful so far

  • @papamagueye6090
    @papamagueye6090 Před 5 lety

    It is so clear... nice job

  • @mballo3516
    @mballo3516 Před 4 lety

    wonderfull ! Thank you very much !

    • @CodAffection
      @CodAffection  Před 4 lety +1

      thank you, let me know if you have any topic suggestion for future videos.

  • @militoelynea
    @militoelynea Před 6 lety +1

    I LOVE YOU!

  • @sanianaqvi4987
    @sanianaqvi4987 Před 3 lety

    Thanks a lot

  • @jaberramadandabash2973
    @jaberramadandabash2973 Před 5 lety +2

    waiting for printing reports operation :D

  • @amirhamzasabuz7977
    @amirhamzasabuz7977 Před 4 lety

    Thank you

  • @kumaresha3348
    @kumaresha3348 Před 4 lety

    Great video Brother. Please create video using MySQL for the same Entity. It is very interesting to learn C# Windows Application.

  • @zerosandones7547
    @zerosandones7547 Před 4 lety

    Can you do something like this but it has a one-to-many relationship? you teach so well! liked and subbed :D

  • @TheThinker-ug3wr
    @TheThinker-ug3wr Před 5 lety +1

    great tutorial and its worked
    good

  • @jeffsonic
    @jeffsonic Před 3 lety

    great job

  • @2005Azm
    @2005Azm Před 6 lety +2

    Great tutorial as always !! sir can please make an example with more than on table ? like a relational database..?

  • @NguyenLuan-xn4ym
    @NguyenLuan-xn4ym Před 4 lety

    So Useful, Thank to u 😃

  • @hazelannmacaraig8155
    @hazelannmacaraig8155 Před 3 lety +3

    Hi sir .Thank you for this tutorial. I would like to ask how if one of the columns in database was integer not string . is it possible to run without any convertion? if not can how can i insert data to the sql that have different data types? Hope to hear from you soon. Thanks in advance

  • @orthodoxx366
    @orthodoxx366 Před rokem

    mantap gaan

  • @anjumanbaqeriaghowari5373

    thanku so much sir

  • @waseembaltistani
    @waseembaltistani Před 6 lety

    If you would added "Search" function also then it will be definitely helpful for the viewers.

  • @skillshared3249
    @skillshared3249 Před 3 lety

    What do you fetch the entity from the database for edit ? You can get it from the grid itself.

  • @learncodego1724
    @learncodego1724 Před rokem

    big like for you

  • @Trakai2009
    @Trakai2009 Před 5 lety

    Great video! But how to sort on, for example by Lastname, by code?

  • @akramtester5249
    @akramtester5249 Před 4 lety

    Hi mr. I viewed your video twice, actually very nice, when you using new way to make connection in page load. actually I always use sqldatasource tool to make connection and get data to another toll(gride view ot ditails view), am trying to mix your method with mine,..thanks

  • @phattainguyen7545
    @phattainguyen7545 Před 3 lety

    Thanks for video. Do i can use db.Entry(model).State = System.Data.Entity.EntityState.Deleted; and saveChanges() to delete without using Detached and Attach(model) ? Thank you for reading.

  • @elegeblege1618
    @elegeblege1618 Před 5 lety +1

    That rooster in the background is killing me 29:41
    However, thank you so much for tutorial !!

    • @denzoV2
      @denzoV2 Před 5 lety

      you dead or alive?

  • @just_kidding_kid
    @just_kidding_kid Před rokem

    Thanks
    Helped
    Regards from Ukraine

  • @johnpaolodelrosario6792

    would like to ask why the state of var entry become detached?

  • @danilobastos6182
    @danilobastos6182 Před 5 lety

    I have a problema when I do a double-click to update the row. Appears a message saying that don't find the column with the name 'CustomerID', but the column name is correct. Somebody passed through for the same thing?

  • @bishangiri677
    @bishangiri677 Před 2 lety +1

    Guru is it possible to sync sql database to web server in c sharp desktop app

  • @heinoplaatjies5334
    @heinoplaatjies5334 Před 5 lety +1

    That was a great clean example, i have tried to do a similar exercise but with an extra field, called section, i used data binding to bind the combobox to a table called sectionTable, when you click on the combobox it dropsdown with a list of all the sections, which is displaying the "Display members", and the "value member" = sect_id. but trying to add a new user to the users table, it gives me an Entity Framwork validation error. System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entites
    here is my code:
    private void btn_AddUser_Click(object sender, EventArgs e)
    {
    users.Name = txt_userName.Text.Trim();
    users.Surname = txt_userSurname.Text;
    users.Email = txt_userEmail.Text;
    users.CellNo = Convert.ToInt32(txt_userCell.Text);
    users.OfficeNo = Convert.ToInt32(txt_userOffice.Text);
    users.LicNo = Convert.ToString(txt_userLicNo.Text);
    users.ID_No = Convert.ToInt32(txt_userID.Text);
    users.Role_id = cbox_RoleName.SelectedIndex;
    users.Sect_id = cbox_SectionName.SelectedIndex;
    users.Username = txt_userUsername.Text;
    users.Password = BCrypt.Net.BCrypt.HashString(txt_userPassword.Text);
    using (BookingVEHEF ef = new BookingVEHEF())
    {
    ef.Users.Add(users);
    ef.SaveChanges();

    };

  • @sohailaslam8090
    @sohailaslam8090 Před 6 lety

    Hi thanks for these tutorials can you post a tutorial on asp.net identity . thanks

    • @CodAffection
      @CodAffection  Před 6 lety

      it's already there but using web api and angular 5.
      user registration : czcams.com/video/h85_GT62K6A/video.html
      login and logout : czcams.com/video/e8BlURn6SFk/video.html
      role based authorization : czcams.com/video/Ks5ADKqPrBQ/video.html

  • @altaymahmudi6385
    @altaymahmudi6385 Před 4 lety

    can you tell me how we can use Trim with datetimepicker? i am getting error and it is really annoying

  • @mazkaibil9108
    @mazkaibil9108 Před 6 lety

    Hello, very good tutorial. Is there any video showing how to do this application with two related tables? please advise.

  • @qurbansaberi479
    @qurbansaberi479 Před 5 lety

    Hi bro
    Can make video about how to insert picture into database how update and how to convert jpg file into bytes

  • @sathishchowdary8346
    @sathishchowdary8346 Před 6 lety

    Its so helpful. Can you develop a sample library application using ASP.NET MVC with different books count and the count should be reduced if any one borrows book. If you do that , It will be great.

  • @BahawalTV
    @BahawalTV Před 4 lety

    Why can't you bind the entity directly to the form controls?

  • @Asif_pathan3636
    @Asif_pathan3636 Před rokem

    👍

  • @christosioannou7359
    @christosioannou7359 Před 4 lety

    i am getting a conflict error after deleting when i do db.SaveChanges();

  • @arslanjappa4335
    @arslanjappa4335 Před 6 lety +2

    sir you always just made crud operaition on text boxes.ur videos will get more appericiation if you include picture,radioboxes combobox and time in crud.bcz i have nt seen such kind of crud operation on youtube.

    • @CodAffection
      @CodAffection  Před 6 lety

      thanks for the suggestion, that's coming up next week.

  • @odehanas
    @odehanas Před 3 lety

    Thanks for the video .. it's very helpful i followed and every thing is fine but in the delete function i have got this message if possible to help solving it.. "The entity type Boolean is not part of the model for the current context.'"
    thanks again ..

  • @AaBb-nn9pl
    @AaBb-nn9pl Před 3 lety

    it is a pity that it is not in Russian, thank you man, I am from Russia

  • @daniela4334
    @daniela4334 Před 6 lety

    What is dgcCustomers on 20:03 video...I am doing these steps in wpf forms and dont get it for what it stands for

    • @akashasuri
      @akashasuri Před 6 lety

      That's dgvCustomers. data grid view Customers ID.

  • @muhammadafzal237
    @muhammadafzal237 Před 2 lety

    How to calculate sum of a column values?

  • @therandom8922
    @therandom8922 Před 4 lety +1

    Gozuuu