Click here to Skip to main content
16,012,508 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello programmers.
I'm working on a Project in Windows Forms and have a Question. I'm importing data from excel into Datagridview without database. I want to save this data so that for the next time when Form starts, display in dgv new datas with datas from previously Form. Can I do this without using database ? Is there any way to save datas in datatable or dataset ?
Posted
Updated 28-Dec-15 7:18am
v4
Comments
Sergey Alexandrovich Kryukov 28-Dec-15 15:05pm    
What have you tried so far?
—SA

1 solution

You can directly get each and every piece of data from each cell using System.Windows.Forms.DataGridViewCell.Value and update your database using appropriate SQL statements. But most widely used approach is based on data binding.

Please see:
How to: Bind Data to the Windows Forms DataGridView Control[^],
Displaying Data in the Windows Forms DataGridView Control[^],
Binding Class (System.Windows.Forms)[^],
http://www.bluevisionsoftware.com/website/books/0972317929/ch06.pdf[^].

These CodeProject articles can also be useful:
A Detailed Data Binding Tutorial[^],
Data binding concepts in .NET windows forms[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900