C# - How to Export DataGridView Data to Ms Excel File in Visual C#

  Рет қаралды 75,087

C# Ui Academy

C# Ui Academy

Күн бұрын

Hey Friends, This is SaLaaR HuSyN, Coming back with another Video, In this tutorial we'll learn how to Export DataGridView Data to Ms Excel File in Visual C# ..
Background Music Link:
+++++++++++++++++++++++++++++++++++++++++++
Download DLL File:
github.com/SaL...
++++++++++++++++++++++++++++++++++++++++++++
For Source Code Please Visit My Github Profile:
github.com/SaL...
++++++++++++++++++++++++++++++++++++++++++++
For Android Ui Tutorials, Please Subscribe Our Channel Android Ui Academy:
/ @androiduiacademy6689
++++++++++++++++++++++++++++++++++++++++++++
if You Have any Query, feel free to contact Us on Facebook:
/ csharpuiacademy
++++++++++++++++++++++++++++++++++++++++++++
Please Subscribe for more Videos

Пікірлер: 79
@CatatanHarian
@CatatanHarian 5 жыл бұрын
Nice tutor sir. I wait for how to import excel file to datagridview, and then import to database too. (Mysql)
@bekindhavepassion3649
@bekindhavepassion3649 3 жыл бұрын
Hello! Thank you, it's cool! Can You be so kind to make a tutorial on how to export data from a form to a googlesheet? It'd be great!
@joaquinbargiela7134
@joaquinbargiela7134 4 жыл бұрын
Can't find DLL file in github, any clues?
@حسينابراهيمعبدالرسول
@حسينابراهيمعبدالرسول 3 жыл бұрын
thank you very very very very very very very very very very very very very very very very much
@michaelnotarte2980
@michaelnotarte2980 4 жыл бұрын
thank for the tutorial its very helpful but i have problem when exporting to excel it only exports the data not the header
@imoleayoemmanuel5278
@imoleayoemmanuel5278 5 жыл бұрын
C# Ui Academy is a blessing to us... sir can you please guide us on how to create a client server installation for a finished Desktop app... in which the client computer will also use the server database
@abhiksingh1999
@abhiksingh1999 3 жыл бұрын
Sir, I'm stuck. Please help. I didn't find the Rows. Count in my case. It's showing the wavy red line. So how do I traverse through each row?
@ArtMeeron
@ArtMeeron 4 жыл бұрын
Hi, on 42 row you write in the end "... Value.ToString();" but when I try to repeat the same, the "Value" doesn't automatically put there and afterwards is says that - "Error CS1061 'TableCell' does not contain a definition for 'Value' and no accessible extension method 'Value' accepting a first argument of type 'TableCell' could be found (are you missing a using directive or an assembly reference?)" Do you know what it could be?
@irriirri6924
@irriirri6924 Жыл бұрын
решил проблему?
@mscotthowell1
@mscotthowell1 5 жыл бұрын
Thanks. This works the way I am used to it, instead of using the new clusterf*** jquery datatables crap; you miss one $ or { or . or [ or ( or what have you break the page. End to end Microsoft solution rocks.
@bereketsiz
@bereketsiz 3 жыл бұрын
Thanks bro. It worked very well for me. Bless your hands.
@mouetteblanc331
@mouetteblanc331 5 жыл бұрын
how to import to datagridview data to excel file in c# ? thanks for this video bro
@RashiCode
@RashiCode 5 жыл бұрын
Nice Sir g
@prosaa9168
@prosaa9168 3 жыл бұрын
i have a System.NullReferenceException: 'Object reference not set to an instance of an object.' can you fix it for me ? please, thank you
@marcstephencorpuz4804
@marcstephencorpuz4804 3 жыл бұрын
sir help. i have followed every code you did but im still getting error System.NullReferenceException: 'Object reference not set to an instance of an object.' the error im getting is at the Excelapp.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString();
@ericdjemba9149
@ericdjemba9149 3 жыл бұрын
true
@lifeof_btbn7147
@lifeof_btbn7147 5 жыл бұрын
thank you very much. Vietnamese with love
@dunghn907
@dunghn907 4 жыл бұрын
haha :D
@KhangNguyen-gd3tj
@KhangNguyen-gd3tj 4 жыл бұрын
hahaha, Bạn không cô đơn
@Jordgubbe
@Jordgubbe 5 жыл бұрын
How do I make a listbox transparent? Please answer.
@darienistornicolae7195
@darienistornicolae7195 3 жыл бұрын
Hello, i have a small problem here. xcelApp.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString(); Error: System.NullReferenceException: 'Object reference not set to an instance of an object.' I mention that i use 5 columns and you introduce the data manually and after it you can export it to Excel
@吳鈎-b1q
@吳鈎-b1q 5 жыл бұрын
Very Nice...
@farappxtrem3788
@farappxtrem3788 3 жыл бұрын
Kindy tell how to save pictures in database and how to publish winforms applications
@javadjamshidi3399
@javadjamshidi3399 5 жыл бұрын
Excellent 👌
@mehribannasibzade1756
@mehribannasibzade1756 4 жыл бұрын
Hi, How can i do it with devexpress grid control? Because no row here
@naufalez
@naufalez 4 жыл бұрын
please make tutorial for export big data like 100K-200K row to excel
@PANandhakumarR
@PANandhakumarR 5 жыл бұрын
Please post video about how to design attendance page in c#(windows form application) with data base ms access
@abdulilahelnagme164
@abdulilahelnagme164 2 жыл бұрын
thank you very much
@Iraqi_Officer
@Iraqi_Officer 5 жыл бұрын
If datagridview have arabic data ? I wont export as arabic layout
@zozmoz8067
@zozmoz8067 2 жыл бұрын
hello I did all what you do , but i get message said "Object reference not set to an instance of an object. " in the line code : xcelApp.Cells[i + 2 , j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString(); could any one helps me please
@muhammadafzal237
@muhammadafzal237 3 жыл бұрын
bro which one is the reference file on your site, I didn't found..!
@rayanhalabi6742
@rayanhalabi6742 4 жыл бұрын
How to saveAs in my project Files after build the excel file?
@asifuddin6364
@asifuddin6364 5 жыл бұрын
System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'
@TheOussamaess1958
@TheOussamaess1958 5 жыл бұрын
Very Nice thx pro
@georgealbo
@georgealbo 3 жыл бұрын
dear sir do you iam doing the same code but the out is out of order
@benjcastelo
@benjcastelo 5 жыл бұрын
Sir, the exporting of data will become slow depends on how many rows that the datagridview has. Is there any other way you can show us how to export data faster? Thanks in advance! Looking forward to your response.
@marcol5374
@marcol5374 5 жыл бұрын
Benjie Castelo use a task to do it and show the status of the operation UI 😃
@srmback
@srmback 2 жыл бұрын
if you get an error do not forget to type the Value as Value?. the whole code looks like this: if(dataGridView1.Rows.Count > 0) { Excel.Application excelApp = new Excel.Application(); excelApp.Application.Workbooks.Add(Type.Missing); for(int i=1; i < dataGridView1.Columns.Count + 1; i++) { excelApp.Cells[1, i] = dataGridView1.Columns[i - 1].HeaderText; } for(int i=0; i < dataGridView1.Rows.Count; i++) { for(int j=0; j < dataGridView1.Columns.Count; j++) { excelApp.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value?.ToString(); } } excelApp.Columns.AutoFit(); excelApp.Visible = true; }
@andreharington2600
@andreharington2600 Жыл бұрын
Worked like a charm
@desgbtv5733
@desgbtv5733 5 жыл бұрын
Nice
@rabbi7rabbi763
@rabbi7rabbi763 5 жыл бұрын
Is it possible to do it from excel file to dataviewgrid ? (im trying to do one application but the excel file have to much informacion to write it one by one (like 5000+ rows....) Can you help me pls :D
@jonathanross9001
@jonathanross9001 2 жыл бұрын
As I know, you can import excel to database and from database to datagridview maybe you did find a better way after two years :D If you did, can you share with me too?
@RashiCode
@RashiCode 5 жыл бұрын
Very help full thank You very much
@abrahameduardoordoricaisla9103
@abrahameduardoordoricaisla9103 4 жыл бұрын
Very simple, thanks so much!
@trungtruong1888
@trungtruong1888 3 жыл бұрын
great
@TheGeardarko
@TheGeardarko 5 жыл бұрын
Gracias, buen tutorial
@Ramdhani03
@Ramdhani03 5 жыл бұрын
i can't fine .dll in your github :(
@aaj3078
@aaj3078 Жыл бұрын
The best thanks!
@alviyudha
@alviyudha 4 жыл бұрын
thanks, you are my hero
@NHGeneral
@NHGeneral 2 жыл бұрын
Hello, can you help to write data to excel file template?
@ishtiaqhussain4370
@ishtiaqhussain4370 5 жыл бұрын
im getting error on this line plz help.....xcelApp.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString(); error:( nullReference Exception: 'Object reference not set to an instance of an object.' )
@bleonmurtezaj1849
@bleonmurtezaj1849 5 жыл бұрын
same
@VTOhr
@VTOhr 5 жыл бұрын
On "dataGridView1" set property "Allow user to add rows" to false - this will remove extra blank row from bottom of dataGrid, and Your code will work.
@shaikhsaalim3532
@shaikhsaalim3532 5 жыл бұрын
Thanks its working
@ridanorani8623
@ridanorani8623 3 жыл бұрын
@@VTOhr thankss
@netrakoirala1
@netrakoirala1 5 жыл бұрын
That's good
@آراۓشان
@آراۓشان 5 жыл бұрын
Nice :-)
@Iraqi_Officer
@Iraqi_Officer 5 жыл бұрын
How i can export to pdf
@martinantoniodejesuslopezm4883
@martinantoniodejesuslopezm4883 5 жыл бұрын
Thank you
@Ahmed95406
@Ahmed95406 5 жыл бұрын
background music link please?
@LP-di1vu
@LP-di1vu 3 жыл бұрын
Thanks again!
@katrykonig2466
@katrykonig2466 3 жыл бұрын
It wouldn't work if there is a combox inside the DG
@clanlocos
@clanlocos 5 жыл бұрын
se repite el valor de la primera columna en todo mi excel =(
@lieusedie5499
@lieusedie5499 4 жыл бұрын
спс мужик
@rafliiskandarkavarera2886
@rafliiskandarkavarera2886 3 жыл бұрын
what happen if client doesnt have excel?
@tonyyhawk7554
@tonyyhawk7554 5 жыл бұрын
Thankyou so much ♥♥♥
@farappxtrem3788
@farappxtrem3788 3 жыл бұрын
I'm not able to download DLL file
@dduRTV
@dduRTV 3 жыл бұрын
How can i export to excel with image?
@farappxtrem3788
@farappxtrem3788 3 жыл бұрын
I've the same question, pls let me know if you got the ans.. ty
@asifuddin6364
@asifuddin6364 5 жыл бұрын
i am getting this error
@StevulaDodoonline
@StevulaDodoonline 5 жыл бұрын
how to export to xml?
@fonzimodev1272
@fonzimodev1272 4 жыл бұрын
this.dataset.tabelname.WriteXml("file.xml")
@ankita302
@ankita302 Жыл бұрын
Someone explain me that for loop😭
@LEXKAY02
@LEXKAY02 4 жыл бұрын
???
@BrunoOliveira-tb3xk
@BrunoOliveira-tb3xk 2 жыл бұрын
Thank you so much
@ddmspeedheat4416
@ddmspeedheat4416 3 жыл бұрын
thank you so much
@phatlengoc9934
@phatlengoc9934 3 жыл бұрын
Thank you so much
Creating Excel Files in C#
55:42
IAmTimCorey
Рет қаралды 127 М.
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26
How to win a argument
9:28
ajaxkmr (ajaxkmr1986)
Рет қаралды 600 М.
Export c# dataGridView to Ms Excel in few seconds
7:34
Ingenious
Рет қаралды 942
Export DataGridView To Excel In c# Windows Application Step By Step
12:17
How to export datagridview to excel in c# windows application
16:29
C# Tutorial - Generate Excel Report in C# | FoxLearn
10:07
Fox Learn
Рет қаралды 14 М.
How to Print a DataGridView using C# with source code
13:37
The Thistle Software
Рет қаралды 5 М.
EXPORT DATABASE INFO TO EXCEL (WINDOWS FORMS C#)
11:43
HENRY JINGURA
Рет қаралды 1,3 М.
C# ile DataGridView Verilerini Excel'e Aktarma Kılavuzu
5:53
EbubekirYazilim
Рет қаралды 585
Смартфоны через 10 лет
0:12
История одного вокалиста
Рет қаралды 1,2 МЛН
Что лучше ноутбук или ПК в бюджете 100к?
0:34