VB.NET Tutorial – Open and Read Excel files/ Import Excel file to DataGridView | FoxLearn

VB.NET Tutorial – Open and Read Excel files/ Import Excel file to DataGridView | FoxLearn

Welcome to FoxLearn In this tutorial, I’ll show you how to open, read and import excel file to DataGridView in Visual Basic .NET using the ExcelDataReader library Open your form designer, then drag TextBox, Button, Label, Combobox and DataGridView from the visual studio toolbox to your winform Next, We will design a simple UI that allows you to select the excel file then load data from the excel file to DataGridView based on the sheet name you selected from the Comboxbox control Right-click on your project, then select Manage Nuget Packages Next, You need to search and install the ExcelDataReader library to your project This is a lightweight and fast library written in c# for reading Microsoft Excel files Add the click event handler to the Browse button allows you to select the excel file, then open and read all sheet data You can use the CreateReader method of the ExcelReaderFactory class to read the excel file The data you read from the excel file will be returned as DataSet Next, you need to read all table names in the DataSet, then add the table name to the Combobox control Finally, you need to specify the table name you want to retrieve the data, then bind the data to the DataGridView Thank you for watching this video and don’t forget to subscribe to my channel

Comments (16)

  1. Was waiting for this. Thanks for uploading!!!

  2. Can you work on open and read word files (.docx & .Doc) in richtextbox and save files as word files (.docx & .Doc) and .txt ?

  3. hello, i created a QR code generating application in C # thanks to you (grandiose your courses) … i have 2 problems now: 1- i have a database in SQL and i would like to store, with a button "Download", the image of the QR code generated in Visual Studio 2019 in my database … 2- I would like, with a button "Find", to bring back the image / all the images linked to an identifier, ID that I will enter in the textbox just next to the "Find" button …. still in c # … can you help me please?

  4. Please make a video about OOP C# can connect with database๐Ÿ˜Š๐Ÿ˜


  6. Can you tell me your discord if you have?
    We can become friends ๐Ÿ™‚
    I always wished i had a friend like this!

  7. Its Simple than uuses Microsoft Office INterop. Tks

  8. How to export datagridview to excel file?? Thank you.

  9. iv a two pbs
    1. that when i click or select the sheet again so it reads the excel again and that wht idn want have
    2. when the sheet is empty so ive to show a messagebx that the Sheet empty si how i can check if the Sheet empty or not thank you so much ๐Ÿ™‚

  10. Can you share the code?. I wrote it the same way you did and i am getting errors especially with reader.AsDataSet(New Exceldatasetconfiguration()

  11. Hi! Great video, very clear instructions. One question, is there a way to extract information from specific cells without directly selecting them from the DataGridView?

  12. Great Video Thank you! How do i save information that I, eventually, want to put in there?

  13. sir, i write many times for learning and need help its for browse a excel file from browse button then it load from a load button then it form has a combo box it shows all column names and just select one of them then has another combo-box which have all values of that column selected name above

  14. inside the btnbrowse i wrote, in the final part,

    cboSheet.SelectedIndex = 0

    this makes the combo box auto select the first index on it, presuming that must have at least one. If there isn't you could use "Try"

    this makes it more praticle, less buttons to press

Comment here