Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
for (i = 0; i <= dt.Rows.Count-1; i++)
                      int newRowIndex = ins.dataGridView1.Rows.Add();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Loan_id"].Value = dt.Rows[i]["Loan_id"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Transaction_no"].Value = dt.Rows[i]["Transaction_no"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Installment_Amount"].Value = dt.Rows[i]["Installment_Amount"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Due_Date"].Value = dt.Rows[i]["Due_Date"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Transaction_Date"].Value = dt.Rows[i]["Transaction_Date"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Fine"].Value = dt.Rows[i]["Fine"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Paid_with_fine"].Value = dt.Rows[i]["Paid_with_fine"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Amount_recieved"].Value = dt.Rows[i]["Amount_recieved"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Paid_Amount"].Value = dt.Rows[i]["Paid_Amount"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Remaining_Amount"].Value = dt.Rows[i]["Remaining_Amount"].ToString();
                          ins.dataGridView1.Rows[newRowIndex].Cells["Customer_CNIC"].Value = dt.Rows[i]["Customer_CNIC"].ToString();
Posted 24-Dec-12 19:51pm
Orcun Iyigun at 25-Dec-12 2:38am
Have you used the magic tool debugger? I think it is something related to this line: &lt;pre lang="c#"&gt;int newRowIndex = ins.dataGridView1.Rows.Add();&lt;/pre&gt;
zeshanazam at 25-Dec-12 2:54am
problem occurring due to which line ?
Sandeep Mewara at 25-Dec-12 6:23am
Debug and see if you are getting correct number of records from DB.
umermhr at 26-Dec-12 5:44am
have you set datasource for Grid....???
A-s-h-l-e-y at 30-Dec-12 2:49am
I think i know why but i'm not sure i like what your using this for...

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

  Print Answers RSS
0 Dnyaneshwar@Pune 1,300
1 Sergey Alexandrovich Kryukov 802
2 Tadit Dash 305
3 ravikhoda 300
4 OriginalGriff 292
0 Sergey Alexandrovich Kryukov 11,441
1 OriginalGriff 6,930
2 Peter Leow 4,850
3 Abhinav S 3,838
4 Maciej Los 3,575

Advertise | Privacy | Mobile
Web01 | 2.8.140421.2 | Last Updated 25 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid