Click here to Skip to main content
Sign Up to vote bad
good
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:51

Comments
Orcun Iyigun - 25 Dec '12 - 2:38
Have you used the magic tool debugger? I think it is something related to this line: <pre lang="c#">int newRowIndex = ins.dataGridView1.Rows.Add();</pre>
zeshanazam - 25 Dec '12 - 2:54
problem occurring due to which line ?
Sandeep Mewara - 25 Dec '12 - 6:23
Debug and see if you are getting correct number of records from DB.
umermhr - 26 Dec '12 - 5:44
have you set datasource for Grid....???
A-s-h-l-e-y - 30 Dec '12 - 2:49
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
Your Filters
Interested
Ignored
     
0 OriginalGriff 293
1 Sergey Alexandrovich Kryukov 143
2 Mohammed Hameed 123
3 Santhosh G_ 108
4 Lohith Korupolu 85
0 Sergey Alexandrovich Kryukov 8,266
1 OriginalGriff 6,306
2 CPallini 3,528
3 Rohan Leuva 2,703
4 Maciej Los 2,234


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