Entity Framework - Insert Update Delete View data in SQL Server using Three Tier | FoxLearn

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 85

  • @crazyiso
    @crazyiso 7 ปีที่แล้ว +1

    This is one of the best educational tutorials about n-tier apps on internet. Thanks for uploading!!!

  • @mrt7948
    @mrt7948 3 ปีที่แล้ว

    super example on using binding source. more example on binding source please with drop down list, master detail relations pls.

  • @brazo98
    @brazo98 11 หลายเดือนก่อน

    Nice Turorial thx a lot for you support.

  • @ermac9900
    @ermac9900 7 ปีที่แล้ว +2

    Hello fox learn
    I want to ask about the display data from more than one table to be used in printing queries
    on report viewer
    Thank you

  • @sdmunoz
    @sdmunoz 8 ปีที่แล้ว

    Nice video, very useful for new developers.

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      Thank you so much :)

  • @davidcedeno878
    @davidcedeno878 6 ปีที่แล้ว

    What is the instrument called 21:12?

  • @alicanhizlan4536
    @alicanhizlan4536 7 ปีที่แล้ว +1

    very good. thanks for everything

  • @2005Azm
    @2005Azm 7 ปีที่แล้ว

    Wonderfull ! Thank you so much for sharing such a knowledge!

  • @dzconcept
    @dzconcept 8 ปีที่แล้ว +2

    NICE
    HOW I CAN ADD TO THIS PROJECT A MASTER /DETAIL RELATION ?
    thanks

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Ok, Thank you for your suggestion. I'll make demo soon

  • @serkankisacik
    @serkankisacik 6 ปีที่แล้ว

    How is the search done here?

  • @ChristianHaugland74
    @ChristianHaugland74 8 ปีที่แล้ว

    Very Nice videos, like your learning style. Could you make more VB.Net videos? It is hard to find good vb videos.

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      OK. Thank you for your suggestion. I'll make soon

  • @МаксИльин-в3ф
    @МаксИльин-в3ф 8 ปีที่แล้ว

    Do you have a lesson where the same principle, but the connection is made through MySqlConnection?

  • @torchok19081986
    @torchok19081986 7 ปีที่แล้ว

    Hi, do you have some videos with EF Core and SQLite ? This would be really helpful. Like always great video.

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว +1

      I haven't got, i'll upload soon

  • @tuandieu4523
    @tuandieu4523 6 ปีที่แล้ว

    Can you do a tutorial about searching using EF - 3Tier ?
    i really need it.
    Thx btw. This video is very useful

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      Ok, thank you for your suggestions

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      th-cam.com/video/Ncbr5axCabM/w-d-xo.html .I uploaded

  • @ntieng
    @ntieng 8 ปีที่แล้ว

    I have used the above code in MySQL. My table called Currency contains two properties, Unit and Rate but only unit is saving. Rate remains 0. I realize that my BindingSource.Current takes only Unit instead of taking both values.

  • @codebuster2716
    @codebuster2716 5 ปีที่แล้ว

    Bravo!!

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Thank you !

  • @safiullah.amarkhail
    @safiullah.amarkhail 7 ปีที่แล้ว

    Hi. l designed a database, l want to know that, can we save the data in multi tables by clicking on one savebutton?

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Yes, You can do that. You can view this video th-cam.com/video/wAfF-MveMIk/w-d-xo.html to know how to do that. Thank you

  • @1995thebama
    @1995thebama 8 ปีที่แล้ว

    Could you make a video (Insert, Update,Delete) with Entity Framework and Stored Procedures?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +2

      OK. Thank you for your suggestion. I'll make soon

    • @1995thebama
      @1995thebama 8 ปีที่แล้ว

      Fox Learn oh thanks :)

  • @darpanrelan4543
    @darpanrelan4543 8 ปีที่แล้ว +1

    Dear sir,,What is code of save button ??

    • @datatabor
      @datatabor 7 ปีที่แล้ว

      It has no code!

    • @edwinfredymoralesmorales3569
      @edwinfredymoralesmorales3569 7 ปีที่แล้ว

      Why?? i ask same, i filled all textboxt in add form then i can't save nothing, what's the code

  • @NoThisIsntMyChannel
    @NoThisIsntMyChannel 5 ปีที่แล้ว

    When I click "Save" on frmAddEditConatct nothing happens... I have revised my code multiple times and it's exactly as in the video. Do you have a link to download the full project?

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Please check your code again. i'll upload to my site soon. thank you !

  • @MrNvQuy
    @MrNvQuy 7 ปีที่แล้ว

    good guide !

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Thank you :)

    • @MrNvQuy
      @MrNvQuy 7 ปีที่แล้ว

      You can make one video about CRUD Many to Many using EF. Example , I have three table are: Students(StudenID, StudentName); Courses(CourseID, CourseName) and StudentCourse(StudenID,CourseID). Students has many Courses and Courses has many Student. When i design in SQL server, i change many to many equal Students has one to many StudentCourse and Course has one to many StudentCourse=> I have 3 table in sql server. But in visual 2015 i create ado.net ef data created 2 table Students and Courses . linq to sql do not support many to many relationship. I can not create query CRUD join 3 tables. You can help me this problem! thank you so much.
      Connection String :

      Student.cs
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.ComponentModel.DataAnnotations.Schema;
      using System.ComponentModel.DataAnnotations;
      namespace EFManyToMany
      {
      public class Student
      {
      [Key]
      public int StudenID { get; set; }
      public string StudentName { get; set; }
      public IList Courses { get; set; }
      }
      }
      Course.cs
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Data.Entity;
      using System.ComponentModel.DataAnnotations.Schema;
      using System.ComponentModel.DataAnnotations;
      namespace EFManyToMany
      {
      public class Course
      {
      [Key]
      public int CourseID { get; set; }
      public string CourseName { get; set; }
      public IList Students { get; set; }
      }
      }
      EmployeeDBContext.cs
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Data.Entity;
      namespace EFManyToMany
      {
      public class EmployeeDBContext: DbContext
      {
      public EmployeeDBContext() : base("EmployeeDBContext")
      {
      Database.SetInitializer(new MigrateDatabaseToLatestVersion("EmployeeDBContext"));
      }
      public DbSet Courses { get; set; }
      public DbSet Students { get; set; }
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
      modelBuilder.Entity()
      .HasMany(t => t.Courses)
      .WithMany(t => t.Students)
      .Map(m =>
      {
      m.ToTable("StudentCourses");
      m.MapLeftKey("StudentID");
      m.MapRightKey("CourseID");
      });
      base.OnModelCreating(modelBuilder);
      }
      }
      }
      Thêm dữ liệu vào các bảng:
      USE Sample
      GO
      INSERT INTO dbo.Courses (CourseName) VALUES ( N'C#')
      INSERT INTO dbo.Courses (CourseName) VALUES ( N'ASP.NET')
      INSERT INTO dbo.Courses (CourseName) VALUES ( N'SQL Server')
      INSERT INTO dbo.Courses (CourseName) VALUES ( N'WCF')
      INSERT INTO dbo.Students ( StudentName ) VALUES ( N'Mike')
      INSERT INTO dbo.Students ( StudentName ) VALUES ( N'John')
      INSERT INTO dbo.StudentCourses VALUES ( N'1', N'1')
      INSERT INTO dbo.StudentCourses VALUES ( N'1', N'2')
      INSERT INTO dbo.StudentCourses VALUES ( N'2', N'1')
      INSERT INTO dbo.StudentCourses VALUES ( N'2', N'2')
      INSERT INTO dbo.StudentCourses VALUES ( N'2', N'3')
      Hiển thị dữ liệu:
      Cách 1:
      using (EmployeeDBContext context = new EmployeeDBContext())
      {
      dataGridView1.DataSource = (from s in context.Students
      from c in context.Courses
      select new
      {
      StudentName = s.StudentName,
      CourseName = c.CourseName
      }).ToList();
      }
      Kết quả:
      Cách 2:
      EmployeeDBContext context = new EmployeeDBContext();
      var stu_id = 1;
      var query = from s in context.Students
      where s.Courses.Any(c => c.CourseID == stu_id)
      select s;
      dataGridView1.DataSource = query.ToList();
      Kết quả:

  • @hichamkhadija1370
    @hichamkhadija1370 7 ปีที่แล้ว

    Hi Again , i can't find a Remove() , Add() ,Entry and Find method , i already add a reference System.data.entity , can you help me please ??

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      I think you should create a model context, then you can find Add, Remove, Entry... method

  • @pablo1beroiza
    @pablo1beroiza 5 ปีที่แล้ว

    Excelent tutorials! Could you send me the project please?

  • @hichamkhadija1370
    @hichamkhadija1370 7 ปีที่แล้ว

    please how find you a references EntityFramwork.SqlServer.dll i can't find it ?! URGENT

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Hi, You can install Entity Framework from nuget

    • @hichamkhadija1370
      @hichamkhadija1370 7 ปีที่แล้ว

      can you send me the link please

    • @hichamkhadija1370
      @hichamkhadija1370 7 ปีที่แล้ว

      Is Ok i find it thank u (y)

  • @junarjacob9858
    @junarjacob9858 8 ปีที่แล้ว

    i like this tut, thank you, more...
    can you add the source code link please
    just like other channel do ;-)

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      Hi, What's your email? thank you

    • @junarjacob9858
      @junarjacob9858 8 ปีที่แล้ว +1

      artc.jacob@gmail.com

  • @danish9742
    @danish9742 7 ปีที่แล้ว

    Why don't you make video for separate select update delete and insert buttons operations. You are always creating data grid view with these operations

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว +1

      Thank you for your suggestion

    • @danish9742
      @danish9742 7 ปีที่แล้ว

      Will be waiting for that

  • @MrNvQuy
    @MrNvQuy 7 ปีที่แล้ว +2

    if add one Users table have relationship many Contacts. You show how to CRUD data to two table. thank ! One problem DataAccessLayer includes InterfaceRepository but RepositoryLayer is beetwen DataLayer and BussinessLayer-> project structure is : Model, Repositories, Bussiness and Presentatiion Layer.
    Link project of fox learn i rebuild www.mediafire.com/file/478ji41wkozc9kc/EF3Tiers.rar

  • @mohammadaziz150
    @mohammadaziz150 7 ปีที่แล้ว

    code pleaes

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Sent. Please check your email. Thank you

  • @GonzoGonschi
    @GonzoGonschi 8 ปีที่แล้ว

    Hey man! what about a video with MySql, Entity Framework, MVVM in WPF and a trivial, step by step example that also the numbskulls among finally understand how to implement the freaking ViewModel. No-one has done this yet, so why don't you give it a try ;)

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว

      Ok. Thank you for your suggestion

  • @l3ecauseOfYou
    @l3ecauseOfYou 8 ปีที่แล้ว +1

    Could you make a video (Insert, Update,Delete) with Entity Framework and Code First?

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +2

      OK. Thank you for your suggestion. I'll make soon

  • @serhatsabah5430
    @serhatsabah5430 ปีที่แล้ว

    Code Pls