Dear All

i need help how to insert data into sql database form a datagrid...

this is the example....

i have view data from tabel sales in a data grid

product name sales jan sales feb sales mar

MILK 10 15 20
Biscuit 7 6 9
Tea 5 15 30

from that kind of data i wouldlike to input it to table target..so i will edit some of
the data then i will save it to tabel target...

i want to just klik one button and will save all data in that datagrid to tabel target


please help me :'(

Recommended Answers

All 2 Replies

Steps:

1. Read Items collection of DataGrid.

foreach (DataGridItem  row in DataGrid1.Items)
   {
        
   }

2. Use ADO.NET data provider to insert each row into a table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.