How to read data from an excel file with C# using Excel Data Reader

  Рет қаралды 8,453

Azhar Techno Coder

Azhar Techno Coder

Күн бұрын

How to read data from an excel file with C# using Excel Data Reader
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using ExcelDataReader;
using System.Data;
namespace readExcelReader
{
internal class Program
{
static void Main(string[] args)
{
var filepath = @"C:\Users\AZHAR PC\Desktop\Excel\writeDataFile.xlsx";
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
using (var streamval = File.Open(filepath, FileMode.Open, FileAccess.Read))
{
using (var reader = ExcelReaderFactory.CreateReader(streamval))
{
var configuration = new ExcelDataSetConfiguration
{
ConfigureDataTable = _ = new ExcelDataTableConfiguration
{
UseHeaderRow = false
}
};
var dataSet = reader.AsDataSet(configuration);
if (dataSet.Tables.Count 0)
{
var dataTable = dataSet.Tables[0];
Console.WriteLine("Rows : " + dataTable.Rows.Count);
Console.WriteLine("Columns : " + dataTable.Columns.Count);
}
else
{
Console.WriteLine("Sheet doesn't exist");
}
}
}
}
}
}
Chapters:
0:00 - Introduction to the video
1:11 - Procedure to read data from excel by excel data reader
8:41 - End Tags and Subscription to the channel
My second Channel:
WrestleTalkByAzhar - / wrestletalkbyazhar
Follow Insta:
/ kingazharjamal
/ fari_digi
Next Steps :
---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
Must Watch Playlists
► 1. Javascript - • Javascript Factory
► 2. Puppetter - • Puppeteer
► 3. Cypress - • Cypress
► 4. Tech works - • Video
► 5. Vbscript Basics To Advanced - • VBScript Part 1 - Fea...
► 6. Jmeter - • Jmeter Tutorials
► 7. Excel - • Videos On Excel
► 8. Appium - • Appium
► 9. Shares - • Shares
► 10. Javascript Interview Questions - • Javascript Interview Q...
► 11. C# Tutorials - • C# Factory
► 12. HTML & CSS - • HTML & CSS
► 13. Browser Console - • Browser Console
► 14. JSON - • Videos on Json
► 15. Specflow - • Specflow Tutorials
► 16. MongoDB - • MongoDB Tutorials
► 17. Postman - • Postman
► 18. Python - • Python
---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
#excel
#csharp
#csharptutorial

Пікірлер: 6
@shahinlgtv5991
@shahinlgtv5991 Жыл бұрын
Good 👍
@rshahinbegum5908
@rshahinbegum5908 Жыл бұрын
Superb
@AzharTechnoCoder
@AzharTechnoCoder Жыл бұрын
Thanks 🤗
@carlosvelazquez1650
@carlosvelazquez1650 11 ай бұрын
You are God in Earth, thank you
@davidpalos9114
@davidpalos9114 9 ай бұрын
Good Videos. Question would you know how to get the hyperlink from an excel cell? using interop? I have not seen anyone show an example of how to do this.
How to read the data form CSV File using C# with special attributes.
2:55
لقد سرقت حلوى القطن بشكل خفي لأصنع مصاصة🤫😎
00:33
Cool Tool SHORTS Arabic
Рет қаралды 28 МЛН
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 109 МЛН
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 60 МЛН
how to read a excel file in C# using Microsoft.Office.Interop.Excel
11:25
C# Tutorial - Import data from Excel to SQL Server | FoxLearn
21:40
How to import data from Excel files to R | R Programming
6:31
Dynamic Data Script
Рет қаралды 97 М.
Using Excel .xlsx files with Python! OpenPyXl Tutorial
7:23
LeMaster Tech
Рет қаралды 63 М.
Creating Excel Files in C#
55:42
IAmTimCorey
Рет қаралды 125 М.
Upload Data From Excel to SQL Server in ASP.Net c#. swift learn
10:01
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 8 МЛН
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 2,4 МЛН
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 549 М.
📱магазин техники в 2014 vs 2024
0:41
djetics
Рет қаралды 653 М.