VB.NET Tutorial – Insert Update Delete Data in Database from DataGridView | FoxLearn


Welcome to FoxLearn In this tutorial, I’ll show you how to insert, update and delete data in GridView using Entity Framework in Visual Basic .NET To play the demo, we will design a simple UI that allows you to insert, update, and delete data from SQL database Right-click on your project, then add an ADO.NET Entity Data Model to your project Next, select your Northwind database, then select the customer table If you don’t have the Northwind database you can download it from the fox-learn website As you know, Entity Framework is an Object Relational Mapper which is a type of tool that simplifies mapping between objects in your software to the tables and columns of a relational database It’s an open source ORM framework for ADO.NET which is a part of .NET Framework You need to add a bindingsource to your GridView The BindingSource component is designed to simplify the process of binding controls to an underlying data source The BindingSource component acts as both a conduit and a data source for other controls to bind to It provides an abstraction of your form’s data connection while passing through commands to the underlying list of data Additionally, you can add data directly to it, so that the component itself functions as a data source You can bind the BindingSource component to both simple data sources, like a single property of an object or a basic collection like ArrayList, and complex data sources, like a database table The BindingSource component acts as an intermediary that provides binding, and currency management services At design time or run time, you can bind a BindingSource component to a complex data source by setting its DataSource and DataMember properties to the database and table, respectively If you want to cancel the operation, you need to filter all objects that have changed status, then check the status of each object Thank you for watching this video and don’t forget to subscribe to my channel

17 Comments

  1. thank you , i need to know how to use 2 DataGridview and filter the second one using the selected item from the first one
    example:"select a customer from the 1st datagrid and filter the second to see only his orders"

  2. Hello I have one question,
    For delete option you choose "dim name as string……"

    Incase there is have two similar name but position all things are different
    But if you delete one name it will delete all similar name.
    How to avoid this issue

  3. Is it just me or does this video have nothing to do with SQL or database? All I see if setting up a bunch of form entries…

  4. Why all these tutorials have just one table? What about relationships? A nice menu to change tables?
    Also.. is it possible to view all tables one at a time with a DataGridView on just 1 form?

    Apreciate the content!

  5. I've hit a problem. db.new_table.load() throws an error 'load isn't a member of 'system.data.entity.dbset(of Parcelmanagement.new_table)' new_table is the name of my table and parcelmanagement2 is the name of my application. Can you help? This is my first attempt using entity framework

  6. Hey thanks a lot for providing such a great support for learning programming. I love your way of teaching and you really inspired me to create my own YouTube channel. PLZ subscribe to me, I need support. I am teaching visual programming with c#. ❤️😇

Leave a Reply

Your email address will not be published. Required fields are marked *