0

I have a datagridview in my C# form App.

How can I create a table directly from datagridview whenever a button is pressed.

Since the datagridview is editable I don't know how many rows of columns there will be to save in the database.

How can I save the whole datagridview to a database and retrieve them? Can I use a unique id as a table name and then use that??

Palle Due
  • 5,929
  • 4
  • 17
  • 32
nvdNK
  • 3
  • 1
  • This might help. https://stackoverflow.com/questions/46798832/how-to-bind-a-datagridview-to-a-sqlite-database – TRS Jun 07 '19 at 10:59
  • Bind dgv to DataTable, List or other appropriate collection type. Create a button click handler which writes data from the bound collection to DB. – Serg Jun 07 '19 at 11:01
  • i need to create a TABLE every time a a button is pressed..binding helps only if there is already a table right? – nvdNK Jun 07 '19 at 11:37
  • just create a table and then loop foreach DGV row and insert a row inside that table... – solujic Jun 10 '19 at 08:43

0 Answers0