VB.NET Database Tutorial - Update a Database From a DataGridView (Visual Basic .NET)

preview_player
Показать описание
In this VB.NET database tutorial, I will show you how to load your database records into a DataGridView and update, insert, and delete records from your database with changes made in the DataGrid.

In this tutorial I'll be using SQLce (Compact Edition), but you can use any database of your choosing.

Fast Forward:
3:00 - Creating a Sample Database
8:09 - Creating our SQL Control Class
21:58 - Working with the DataGridView

TUTORIAL FEATURES
SQL Ce (Compact Edition) - Sample Database
DataGridView - Populate DataGrid and Update Database
Button - Save
Classes - SQLControl
SQL DataSet, DataAdapter, SqlCommand

Рекомендации по теме
Комментарии
Автор

I have not programmed since Fortran in College. Object oriented programming has always been a hurdle. I have been using Excel to manage data for one of my hobbies and went down the Excel rabbit hole. I have now decided to write a VB program to manage the data. Among all of the sources I have relied upon to introduce various areas of the program your tutorials are by far superior to anything else I have found. Thank you!

stanmalinky
Автор

This was amazing. I'm using MySQL and I was able to adapt easily. One could Google literally for weeks before coming up with this volume of information. Clearly stated, concise and complete. Thank you so much!!!

randym
Автор

This video is over 4 years old and still so helpful. I like your whole series and I am subscribed.

k.w.fisher
Автор

I first watched this and your other excellent videos a few years ago, in the context of MS-Access database, similar kinds of ideas. But now, I need to migrate that Access database to SQL. I've been spending the better part of the last few weeks getting up to speed by myself on using SQL and migrating my Access database to SQL and I'm proud to say that I now understand the business of creating tables with primary key and identity set at the get go, otherwise, SQL Server will not allow to change the field (column) once it's created. Thank you so much for having taken the time to do this and your other excellent videos.

rogerbreton
Автор

THANK YOU! You may have just shed some light on why my program wasn't doing this. Hopefully now I should be able to make it work. Subscribed! :)

edwingiovannidejesus
Автор

Awesome tutorial, worked seamlessly for me. Saved me from hari cari, and probably extra days of trial and error.

lesliechow
Автор

this really helped me a lot! I hope more tutorials be uploaded :)

bethueldelacruz
Автор

Hi, It is a great series of video that leads beginners to write their code in a more professional way.

I used to learn VB 6.0 on my own and now I would like to shift my IDE to Visual Studio, so I could keep my programming skills updated as the trend move forward.

It will be very appreciated if you can make a series of video demonstrating how to make data export and Print a report in VS. I have not idea how to use those Print controls so far.

Daniel from China

翟秋语
Автор

Great Video! It rolls so much info into a single training. Do you have a video on how we can accomplish The updates if using multiple tables? That is what I am trying to do

ianelkin
Автор

I am trying to incorporate this code into a project I am working with and trying to figure out what the best way to return the ID of a new record when running an INSERT query

ianelkin
Автор

Nice tutorial. Thumbs up. Learnt several lessons here. Though I still can't understand some few things here because I am an advanced newbie and do not use custom private class, however I will understand later with much practice.

JonathanIsmaila
Автор

Hello,
You've done a fantastic job at creating these VB.NET videos, I've learned so much so fast. Thank You
I'm finally moving from the VB6 world to the VB.NET world, yes I know I'm a little behind but in a production world it takes a long time to move from one to the other.
My question is I would like to know how to use the DataGridView to add records to a SQL Server database table, also show the DataGridView control with default column headers and set columns to a specific default width.
I hope this makes sense.
Thanks

pconstantinos
Автор

Awesome video! Very well explained. Subscribed!

Just an idea: I'd love to see any vids/ideas you have on integrating Outlook with MSAccess. My current application uses an Access table linked to Outlook Contacts. It has severe limitations. It can't enforce Referential Integrity for foreign keys. For example, my "Projects" table (linked to Contacts via CustomerID) allows entry of a CustomerID that doesn't exist in Contacts. There are other issues. I can code some work-arounds that are ugly and inelegant. I'm guessing there are much better ways. I wouldn't have any issues if I could sync my phone contacts to an Access table. But, it appears impossible for iPhone (at least as far as I know)

Anyway, love the video. I'm looking forward to watching your other ones this afternoon.

mef
Автор

Wonderful !
The code is clean with comments, it's a good work ;-)
It work well too with VB 2012

arnaudf.
Автор

Thanks for a great tutorial. Much appreciated!

lientjievanderwalt
Автор

Hi there,

I'm new with database and must say that your tutorial is awesome. I have a question for you please - if I have 2 tables in a dataset, do I have to create another SQLControl object?

realbigbear
Автор

Thanks for this Video. Do you need to add reference to SQL for a regular sql Database?

francisf.amunde
Автор

hi, sir
your tutorials are simply understandebal and great,
i need some more helps with acces data base i.e haw to use numaric desbibal and date expretion to insert and select

yogeshvaidya
Автор

this tutorial is just great, but I have a question, what if I have several tables then I use listbox to display those tables and also datagridview to display the data from the tables, how to make change on the data and save it to the database ? is it doable ? in this case I'm using access databse
I'm a newbie and I always get confused when I have to use several tables
anyway, you're doing a great job, thank you so much

januarekosubagio
Автор

Hi there, i've gotta say you really did a great job.

I've been away for VB for 7 years and my manager wanted me to pick up VB again and using SQL. Thanks to you I'm very close on starting to create a program for my office.

But I'm having a little trouble when I try to replace SqlServerCe by directly calling the database on my office server. (I'm not using any local database.)

I'm getting error when I try to execute this command:

SQL.SQLDA.UpdateCommand = New


<InvalidOperationException was unhandled>

Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.


I'm sure something is wrong when i try to change it, but I just want to know is it possible to update the database on server instead of local database by using data grid view?

Thank you for your effort and help sir.

Toomba
visit shbcf.ru