Hi all
Below is the code by which i am printing data from dataset
sr.WriteLine(i.ToString() + Strings.Space(3 - Strings.Len(i.ToString())) + String.Format("{0,-6:dd MMM yyyy}", ds.Tables[0].Rows[i][1]) + Strings.Space(13 - Strings.Len(String.Format("{0,-6:dd MMM yyyy}", ds.Tables[0].Rows[i][1]))) + Strings.Mid(per.ToString(), 1, 25) + Strings.Space(((35 - Strings.Mid(per.ToString(), 1, 25).Length))) + ds.Tables[0].Rows[i][3].ToString() + Strings.Space(12 - Strings.Len(ds.Tables[0].Rows[i][3].ToString())) + Strings.Space(12 - Strings.Len(ds.Tables[0].Rows[i][5].ToString())) + ds.Tables[0].Rows[i][5].ToString() + Strings.Space(12 - Strings.Len(ds.Tables[0].Rows[i][6].ToString())) + ds.Tables[0].Rows[i][6].ToString() + Strings.Space(12 - Strings.Len(ds.Tables[0].Rows[i][7].ToString())) + ds.Tables[0].Rows[i][7].ToString());
e.g. Records are coming like this
Date Particulars ChequeNo Withdrawals Deposite Balance
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
01 Nov 2011 By Cash 0 0.0000 210.0000 210.00
02 Nov 2011 By Cash 0 0.0000 15000.0000 15210.00
02 Nov 2011 To TRF TD/RD/34 DAMLE AMO 0 6000.0000 0.0000 9210.00
15 Nov 2011 By KTH ABB Cash BY CASH D 0 0.0000 2813.0000 12023.00
Now i want to add serial number before the date.
like
1
2
3...
and suppose first time it printed 7 lines then next time the serial number should start from 8.
Please tell me how to do this.