Click here to Skip to main content
Rate this: bad
good
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
Comments
Orcun Iyigun at 25-Dec-12 2:38am
   
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 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 604
1 thatraja 370
2 OriginalGriff 310
3 Gihan Liyanage 214
4 kbrandwijk 204
0 OriginalGriff 737
1 Dnyaneshwar@Pune 604
2 Kornfeld Eliyahu Peter 505
3 Sergey Alexandrovich Kryukov 405
4 thatraja 370


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100