hi,
Datagridview have 50 column(these columns name is 1 to 50), need to database cycle out of the value stored in the corresponding column(Table there are 4 column stored value is also digital )
demoNUM table Data as follows:
SELECT * FROM demoNUM;
result:
r_1 r_2 r_3 r_4
1 2 4 50
1 2 3 5
2 3 5 50
Below is the effect of imitation:
datagridview columns name: 1 2 3 4 5 .....50
rows: 1 2 4 50
1 2 3 5
2 3 5 50
thanks
Loading

VulpesPosted Aug 22, 2012, 1:46 PM
VulpesPosted Aug 24, 2012, 6:57 AM
Try it like this:
Ken HPosted Aug 24, 2012, 1:58 AM
thanks
Ken HPosted Aug 22, 2012, 8:23 PM
VulpesPosted Aug 22, 2012, 6:09 AM
Nattudurai EswaramurthyPosted Aug 20, 2012, 5:41 AM
its simple. Just look through all the rows and select a each column for the row for example
and do appropriately.
eg.
for(int i=0;i< GridView1.Rows.count;i++)
{
GridView1.Rows[i].Cells[0].Value
}
VulpesPosted Aug 20, 2012, 4:58 AM
Ken HPosted Aug 19, 2012, 8:57 PM
i do't know how to upload attachments in here,I'd like to upload attachments may let you know some.
thanks
VulpesPosted Aug 19, 2012, 1:26 PM
The code to populate the DGV's rows will then be:
dataGridView1.RowCount = dt.Rows.Count;
for(int i = 0; i < dt.Rows.Count; i++)
{
DataRow dr = dt.Rows[i];
for(int j = 0; j < 4; j++)
{
int k = int.Parse(dr[j].ToString());
dataGridView1.Rows[i].Cells[k - 1].Value = k;
}
}