How To Merge Content of First Pdf to Second PDF using itext sharp and How to add image logo in pdf


using (Stream inputPdfStream = new FileStream(“input.pdf”, FileMode.Open, FileAccess.Read, FileShare.Read))
using (Stream inputImageStream = new FileStream(“some_image.jpg”, FileMode.Open, FileAccess.Read, FileShare.Read))
using (Stream outputPdfStream = new FileStream(“result.pdf”, FileMode.Create, FileAccess.Write, FileShare.None))
{
var reader = new PdfReader(inputPdfStream);
var stamper = new PdfStamper(reader, outputPdfStream);
var pdfContentByte = stamper.GetOverContent(1);

Image image = Image.GetInstance(inputImageStream);
image.SetAbsolutePosition(100, 100);
pdfContentByte.AddImage(image);
stamper.Close();
}

how to bind dropdownlist for edit item template in gridview using c#


 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if ((e.Row.RowState & DataControlRowState.Edit) > 0)
                {
                    var ddl = (DropDownList)e.Row.Cells[1].FindControl("ddlCity");
                    ddl.DataSource = GetRecordsCities();
                    ddl.DataValueField = "ID";
                    ddl.DataTextField = "CityName";
                    ddl.DataBind();
                    var dr = e.Row.DataItem as DataRowView;
                    if (dr != null)
                    {
                        ddl.SelectedValue = dr[1].ToString();
                    }
                }
            }
        }

How To Insert from CSV to Xml Bank Statment Data into Tables and Matching/Unmatching of Records.


ALTER PROCEDURE spImportBankStatement
(
@xmlStatements  NVARCHAR(MAX),
–declare @xmlStatements as NVARCHAR(MAX)
–set @xmlStatements=N'<DocumentElement>  <BankStatements>    <TransDate>2014-04-01T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PATHMEADS HSG GNRL</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>1928.34</TransCredit>    <TransBalance>52898.63</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-01T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>BANK OF SCOTLAND . A/32512624-9</TransDescription>    <TransDebit>247.2</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>52651.43</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-01T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>C&amp;G . 5000003469538500</TransDescription>    <TransDebit>340.1</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>52311.33</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-01T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PALMER GF . NO REF . RP4671262632218100</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>390</TransCredit>    <TransBalance>52701.33</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-01T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ROSE SE . G I STACY . RP4671163082788400</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>60</TransCredit>    <TransBalance>52761.33</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-01T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>DOUGLAS R . 16A BURLEIGH PARAD . RP4679969725651800</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>150</TransCredit>    <TransBalance>52911.33</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-01T00:00:00+05:30</TransDate>    <TransType />    <TransAccount>61477868</TransAccount>    <TransDescription>INTEREST (NET)</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>18.03</TransCredit>    <TransBalance>52929.36</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-06T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PLUS- HISCOX . ISMAIO590/  1-U</TransDescription>    <TransDebit>69.63</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>52859.73</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-06T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2355</TransDescription>    <TransDebit>758.58</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>52101.15</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-07T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SCHUMANN T</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>52426.15</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-07T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SIMON J H FRASER</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>390</TransCredit>    <TransBalance>52816.15</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-07T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>MR NICHOLAS RICHAR</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>710</TransCredit>    <TransBalance>53526.15</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-07T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>NAGENDRAN R R T/</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>4666.67</TransCredit>    <TransBalance>58192.82</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-07T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>AXA INSURANCE . 719138A</TransDescription>    <TransDebit>1889.89</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>56302.93</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-12T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>K KOENTOPP</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>2100</TransCredit>    <TransBalance>58402.93</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-12T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>WILLIAM ELSON</TransDescription>    <TransDebit>30</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>58372.93</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-12T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>4</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>58697.93</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-12T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>5</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>170</TransCredit>    <TransBalance>58867.93</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-12T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>6</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>149.31</TransCredit>    <TransBalance>59017.24</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-15T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>AL HAMRA FORT HOTE . AE         5809.20 . XR          5.4716 . CD 9922</TransDescription>    <TransDebit>1061.7</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>57955.54</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-15T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>OVERSEAS TRANSACTI . CD 9922</TransDescription>    <TransDebit>1</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>57954.54</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-15T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>MIRACLE COFFEE SHO . CD 9922</TransDescription>    <TransDebit>47.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>57907.04</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-16T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>7</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>58232.04</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-19T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>CRUZ LA5 1 . 46 BRUNSWICK</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>867</TransCredit>    <TransBalance>59099.04</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-19T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2359</TransDescription>    <TransDebit>253.46</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>58845.58</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-20T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PC WORLD . CD 9922</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>229</TransCredit>    <TransBalance>59074.58</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-20T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>WWW.EASYSPACE.COM . CD 9922</TransDescription>    <TransDebit>135.13</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>58939.45</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-21T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ZEGAOULA M . DEPOSITMUS10A . 646050623461124001</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>543</TransCredit>    <TransBalance>59482.45</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-23T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>APCOA PARKING (UK) . CD 9922</TransDescription>    <TransDebit>6</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>59476.45</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-26T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>FIRST CAPITAL CONN . CD 9922</TransDescription>    <TransDebit>7.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>59468.95</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-26T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>O M ISMAIL</TransDescription>    <TransDebit>1601</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>57867.95</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-26T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2358</TransDescription>    <TransDebit>290.23</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>57577.72</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-26T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2361</TransDescription>    <TransDebit>2296.88</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>55280.84</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-26T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>8</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>40</TransCredit>    <TransBalance>55320.84</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-27T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>WWW.BCF.NHS.UK . CD 9922</TransDescription>    <TransDebit>4</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>55316.84</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-27T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ASDA SUPERSTORE . CD 9922</TransDescription>    <TransDebit>6.88</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>55309.96</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-27T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TFL MFM . CD 9922</TransDescription>    <TransDebit>7.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>55302.46</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-27T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>DIXONS . CD 9922</TransDescription>    <TransDebit>149.99</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>55152.47</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-27T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>EN HICK . HICK . 002010042700129529</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>270</TransCredit>    <TransBalance>55422.47</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-28T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>VELASCO PETE</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>953.33</TransCredit>    <TransBalance>56375.8</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-28T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SKY DIGITAL . 00621050862583</TransDescription>    <TransDebit>47.48</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>56328.32</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-28T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>NELSON M A . THE BROOKS 4 . 22023849446621000N</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>1050</TransCredit>    <TransBalance>57378.32</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-29T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PEREIRA VA</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>270</TransCredit>    <TransBalance>57648.32</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-29T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2362</TransDescription>    <TransDebit>234</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>57414.32</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-29T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TERENCE CHARLES LE . TCL 16B BURLEIGH P . 64144530644301000N</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>899.4</TransCredit>    <TransBalance>58313.72</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-04-30T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>HIGH HOLBORN</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>1958</TransCredit>    <TransBalance>60271.72</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>MR SAM BIRCH</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>300</TransCredit>    <TransBalance>60571.72</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PATHMEADS HSG GNRL</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>1928.34</TransCredit>    <TransBalance>62500.06</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TIMES SUBSCRIPTION . 1907573/0026302427</TransDescription>    <TransDebit>24</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>62476.06</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>BANK OF SCOTLAND . A/32512624-9</TransDescription>    <TransDebit>247.2</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>62228.86</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>C&amp;G . 5000003469538500</TransDescription>    <TransDebit>340.1</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>61888.76</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ROSE SE . G I STACY . RP4671163097542700</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>60</TransCredit>    <TransBalance>61948.76</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PALMER GF . NO REF . RP4671262645803500</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>390</TransCredit>    <TransBalance>62338.76</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-04T00:00:00+05:30</TransDate>    <TransType />    <TransAccount>61477868</TransAccount>    <TransDescription>INTEREST (NET)</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>23.56</TransCredit>    <TransBalance>62362.32</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-05T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ASDA SUPERSTORE . CD 9922</TransDescription>    <TransDebit>13</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>62349.32</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-05T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PLUS- HISCOX . ISMAIO590/  1-U</TransDescription>    <TransDebit>69.63</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>62279.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-06T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ZEGAOULA M</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>62604.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-06T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SCHUMANN T</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>62929.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-06T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SIMON J H FRASER</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>390</TransCredit>    <TransBalance>63319.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-06T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>MR NICHOLAS RICHAR</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>710</TransCredit>    <TransBalance>64029.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-06T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>NAGENDRAN R R T/</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>4666.67</TransCredit>    <TransBalance>68696.36</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-06T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2364</TransDescription>    <TransDebit>780</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>67916.36</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-07T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>FIRST CAPITAL CONN . CD 9922</TransDescription>    <TransDebit>14.8</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>67901.56</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-07T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>AXA INSURANCE . 719138A</TransDescription>    <TransDebit>1995.9</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>65905.66</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-10T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>CRUZ LA5 1 . 46 BRUNSWICK</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>867</TransCredit>    <TransBalance>66772.66</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-10T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>WILLIAM ELSON</TransDescription>    <TransDebit>30</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>66742.66</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-10T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2367</TransDescription>    <TransDebit>117.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>66625.16</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-10T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2363</TransDescription>    <TransDebit>822.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>65802.66</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-11T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TFL MFM . CD 9922</TransDescription>    <TransDebit>15</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>65787.66</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-11T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2366</TransDescription>    <TransDebit>136.56</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>65651.1</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-12T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>K KOENTOPP</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>2100</TransCredit>    <TransBalance>67751.1</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-12T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2365</TransDescription>    <TransDebit>587.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>67163.6</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-17T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TOYS R US 3646 . CD 9922</TransDescription>    <TransDebit>153.98</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>67009.62</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-17T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>9</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>30</TransCredit>    <TransBalance>67039.62</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-17T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>10</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>8106.07</TransCredit>    <TransBalance>75145.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-17T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>11</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>75</TransCredit>    <TransBalance>75220.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-20T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SCREWFIX BOREHAMWO . CD 9922</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>7.15</TransCredit>    <TransBalance>75227.84</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-20T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SCREWFIX BOREHAMWO . CD 9922</TransDescription>    <TransDebit>15.23</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>75212.61</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-20T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>WWWAMERICAN EXPRES . CD 9922</TransDescription>    <TransDebit>486.92</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>74725.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-20T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2369</TransDescription>    <TransDebit>1128</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>73597.69</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-20T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>12</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>150.36</TransCredit>    <TransBalance>73748.05</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-21T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2370</TransDescription>    <TransDebit>87.99</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>73660.06</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-21T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2360</TransDescription>    <TransDebit>120</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>73540.06</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-24T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>MR LUIS M T COELHO . 2A LUIS . 34120244707840000N</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>750</TransCredit>    <TransBalance>74290.06</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-25T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>HOLLYWOOD BOWL FIN . CD 9922</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>11.25</TransCredit>    <TransBalance>74301.31</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-25T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>REGENCY RESTAURANT . CD 9922</TransDescription>    <TransDebit>16.8</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>74284.51</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-25T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>HOLLYWOOD BOWL FIN . CD 9922</TransDescription>    <TransDebit>52.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>74232.01</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-25T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>O M ISMAIL</TransDescription>    <TransDebit>1601</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>72631.01</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-25T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ORTIZ C . 10A ORTIZ . 121962459210525001</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>72956.01</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-25T00:00:00+05:30</TransDate>    <TransType>DEP</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>HIGH HOLBORN</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>1958</TransCredit>    <TransBalance>74914.01</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-26T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PIZZA HUT 481 . CD 9922</TransDescription>    <TransDebit>77.58</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>74836.43</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-26T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2373</TransDescription>    <TransDebit>612.37</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>74224.06</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-26T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TERENCE CHARLES LE . TCL 16B BURLEIGH P . 61144616880119000N</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>899.4</TransCredit>    <TransBalance>75123.46</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-27T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>B&amp; Q . CD 9922</TransDescription>    <TransDebit>4.39</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>75119.07</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-27T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>THE PAINTBALL CENT . CD 9922</TransDescription>    <TransDebit>80</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>75039.07</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-27T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>VELASCO PETE</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>953.33</TransCredit>    <TransBalance>75992.4</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-27T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SKY DIGITAL . 00621050862583</TransDescription>    <TransDebit>43.89</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>75948.51</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-27T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2368</TransDescription>    <TransDebit>290.23</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>75658.28</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-27T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>EN HICK . HICK . 002010052700127270</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>300</TransCredit>    <TransBalance>75958.28</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-05-28T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>NELSON M A . THE BROOKS 4 . 28024102946908000N</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>1050</TransCredit>    <TransBalance>77008.28</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PEREIRA VA</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>300</TransCredit>    <TransBalance>77308.28</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>MR SAM BIRCH</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>300</TransCredit>    <TransBalance>77608.28</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PATHMEADS HSG GNRL</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>1928.34</TransCredit>    <TransBalance>79536.62</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TIMES SUBSCRIPTION . 1907573/002630241X</TransDescription>    <TransDebit>24</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79512.62</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PLUS- HISCOX . 1189253</TransDescription>    <TransDebit>87.11</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79425.51</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>BANK OF SCOTLAND . A/32512624-9</TransDescription>    <TransDebit>247.2</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79178.31</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>DD</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>C&amp;G . 5000003469538500</TransDescription>    <TransDebit>340.1</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>78838.21</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PALMER GF . NO REF . RP4671262658486800</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>390</TransCredit>    <TransBalance>79228.21</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>NICHOLAS HUGHES . N HUGHES WD23 3HJ . 00151664632BBBBXCH</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>710</TransCredit>    <TransBalance>79938.21</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType>FPI</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ROSE SE . G I STACY . RP4671163112094800</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>60</TransCredit>    <TransBalance>79998.21</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-01T00:00:00+05:30</TransDate>    <TransType />    <TransAccount>61477868</TransAccount>    <TransDescription>INTEREST (NET)</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>20.82</TransCredit>    <TransBalance>80019.03</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-02T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>REGENCY RESTAURANT . CD 9922</TransDescription>    <TransDebit>25.4</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79993.63</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-02T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TESCO STORE 3050 . CD 9922</TransDescription>    <TransDebit>44.02</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79949.61</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-02T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>TESCO STORE 2126 . CD 9922</TransDescription>    <TransDebit>71.48</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79878.13</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-02T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2374</TransDescription>    <TransDebit>120</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79758.13</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-03T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>JACRO CINEMA SALES . CD 9922</TransDescription>    <TransDebit>48.88</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>79709.25</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-03T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ZEGAOULA M</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>80034.25</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-03T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SCHUMANN T</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>80359.25</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-03T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>SIMON J H FRASER</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>390</TransCredit>    <TransBalance>80749.25</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-03T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>NAGENDRAN R R T/</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>4666.67</TransCredit>    <TransBalance>85415.92</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-03T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2372</TransDescription>    <TransDebit>793.02</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>84622.9</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-07T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>PROTYRE ENFIELD . CD 9922</TransDescription>    <TransDebit>147.27</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>84475.63</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-07T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2375</TransDescription>    <TransDebit>179.78</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>84295.85</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-08T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>LA-VITA . CD 9922</TransDescription>    <TransDebit>231.8</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>84064.05</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-08T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>CRUZ LA5 1 . 46 BRUNSWICK</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>867</TransCredit>    <TransBalance>84931.05</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-08T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2377</TransDescription>    <TransDebit>775.5</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>84155.55</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-09T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2376</TransDescription>    <TransDebit>323.12</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>83832.43</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-10T00:00:00+05:30</TransDate>    <TransType>BGC</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>K KOENTOPP</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>2100</TransCredit>    <TransBalance>85932.43</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-10T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>WILLIAM ELSON</TransDescription>    <TransDebit>30</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>85902.43</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-10T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2380</TransDescription>    <TransDebit>290.23</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>85612.2</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-11T00:00:00+05:30</TransDate>    <TransType>DEB</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>WYCOMBE DISTRICT COUNC . CD 9922</TransDescription>    <TransDebit>2</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>85610.2</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-11T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2382</TransDescription>    <TransDebit>183.46</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>85426.74</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-14T00:00:00+05:30</TransDate>    <TransType>SO</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>ORI H ORG F</TransDescription>    <TransDebit>0</TransDebit>    <TransCredit>325</TransCredit>    <TransBalance>85751.74</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-14T00:00:00+05:30</TransDate>    <TransType>CHQ</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>2379</TransDescription>    <TransDebit>1881</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>83870.74</TransBalance>  </BankStatements>  <BankStatements>    <TransDate>2010-06-14T00:00:00+05:30</TransDate>    <TransType>TFR</TransType>    <TransAccount>61477868</TransAccount>    <TransDescription>V DJEMAL</TransDescription>    <TransDebit>6000</TransDebit>    <TransCredit>0</TransCredit>    <TransBalance>77870.74</TransBalance>  </BankStatements></DocumentElement>’
–declare @message as NVARCHAR(MAX)
@message NVARCHAR(MAX) output
)
AS
BEGIN TRANSACTION
SET NOCOUNT ON;
BEGIN TRY
DECLARE @XMLDocPointer INT  
IF(@xmlStatements!=”)
        BEGIN    
        IF(OBJECT_ID(‘tempdb..#BankStatement’) Is Not NULL)
                        Begin
                        TRUNCATE TABLE #BankStatement
                        DROP TABLE #BankStatement
                        End

            
            EXEC sp_xml_preparedocument @XMLDocPointer OUTPUT, @xmlStatements
            SELECT TransDate,TransType,TransAccount ,TransDescription,TransDebit,TransCredit,TransBalance     INTO #BankStatement     
                FROM OPENXML(@XMLDocPointer,’/DocumentElement/BankStatements’,2)    
                WITH  (TransDate DATETIME,TransType NVARCHAR(MAX),TransAccount INT,TransDescription VARCHAR(max),
                TransDebit  DECIMAL(10,2),TransCredit DECIMAL(10,2),TransBalance DECIMAL(10,2))                            
                EXEC sp_xml_removedocument @XMLDocPointer
                    
                    ;WITH Ignored AS(
                                SELECT TransDate, TransType, TransDescription, TransDebit, TransCredit,TransBalance FROM #BankStatement
                                            INTERSECT
                                SELECT Date,ChqNo, Description,Debit,Credit,Balance FROM Transactions
                                )
                        SELECT * FROM Ignored                        
                    
                    ;WITH Added AS(
                                SELECT TransDate, TransType, TransDescription, TransDebit, TransCredit,TransBalance FROM #BankStatement
                                            EXCEPT
                                SELECT Date,ChqNo, Description,Debit,Credit,Balance FROM Transactions
                                )                    
                        SELECT *FROM Added

                        ;WITH Inserted AS(
                                SELECT TransDate, TransType, TransDescription, TransDebit, TransCredit,TransBalance FROM #BankStatement
                                            EXCEPT
                                SELECT Date,ChqNo, Description,Debit,Credit,Balance FROM Transactions
                                )                    
                        INSERT INTO Transactions(Date,ChqNo,Description,Debit,Credit,Balance)  SELECT TransDate,TransType,TransDescription,TransDebit,TransCredit,TransBalance  FROM Inserted
                        
                        IF(OBJECT_ID(‘tempdb..#BankStatement’) Is Not NULL)
                        Begin
                        TRUNCATE TABLE #BankStatement
                        DROP TABLE #BankStatement
                        End
        
        END
SET @message=’Done’
COMMIT    
END TRY
BEGIN CATCH
ROLLBACK
SET @message=ERROR_MESSAGE()
END CATCH

–TRUNCATE TABLE Transactions
–SELECT *FROM Transactions
–SELECT COUNT(*) FROM Transactions

How to Read CSV Into DataTable Using asp.net c#


public DataTable CsvFileToDatatable(string path, bool IsFirstRowHeader)
{
string header = "No";
string sql = string.Empty;
DataTable dataTable = null;
string pathOnly = string.Empty;
string fileName = string.Empty;
try
{
pathOnly = Path.GetDirectoryName(path);
fileName = Path.GetFileName(path);
sql = @"SELECT * FROM [" + fileName + "]";
if (IsFirstRowHeader)
{
header = "Yes";
}
using (OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pathOnly +
		 ";Extended Properties=\"Text;HDR=" + header + "\""))
{
using (OleDbCommand command = new OleDbCommand(sql, connection))
{
using (OleDbDataAdapter adapter = new OleDbDataAdapter(command))
{
dataTable = new DataTable();
dataTable.Locale = CultureInfo.CurrentCulture;
adapter.Fill(dataTable);
}
}
}
}
finally
{
}
return dataTable;
}

DropDownList in GridView Async and find Control in Class File in c#.net


In this article, I have described the ways of keeping DropDownList in the GridView and binding the data by preserving the default SelectedValue. Apart from DropDownList, I have also shown how to keep CheckBox, RadioButtonList, TextBox in the GridView and preserving the default data,how to find control in class file ,how to use async Trigger in Update Panel using GridView in C#.net

Placing the DropDownList in the GridView

To place the DropDownList in the GridView, you will have to use asp:TemplateField that under <Columns>, Generally you will need to use the DropDownList in the GridView in the Edit mode (under EditItemTemplate, However this solution will work for you even if you want to place the DropDownList in the ItemTemplate) where you want your user to select the data from the DropDownList and update the record. A typical example is shown in the picture below

Image

The aspx page code of above GridView is below

<%@ Page Title="" Language="C#" MasterPageFile="~/GridMaster.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"
    ClientIDMode="Static">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" ClientIDMode="Static">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="GridView1" />
        </Triggers>
        <ContentTemplate>
            <asp:Label ID="lblMessage" runat="server" EnableViewState="true" />
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" ClientIDMode="Static"
                GridLines="None" AutoGenerateEditButton="True" OnRowCancelingEdit="GridViewCancelEdit"
                OnRowEditing="GridViewEdit" OnRowUpdating="GridViewUpdate" 
                DataKeyNames="PersonID" CellPadding="4" ForeColor="#333333">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField DataField="PersonID" HeaderText="Person ID" ReadOnly="True" Visible="false" />
                    <asp:TemplateField HeaderText="First Name">
                        <ItemTemplate>
                            <%# Eval("FName") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Eval("FName") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Last Name">
                        <ItemTemplate>
                            <%# Eval("LName") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtLastName" runat="server" Text='<%# Eval("LName") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Department DropDown">
                        <ItemTemplate>
                            <%# Eval("DeptName")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="dropDownDept" DataSource="<%# BindDropDownDepartment() %>"
                                DataTextField="DeptName" DataValueField="DeptId" runat="server" SelectedValue='<%# Eval("DeptId").ToString() %>'>
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="CustomCheckBox Field">
                        <ItemTemplate>
                            <%# Eval("IsActive") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:CheckBox ID="chkActive" runat="server" Checked='<%# Eval("IsActive") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="RadioButtonField">
                        <ItemTemplate>
                            <%# Eval("IsActive") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:RadioButtonList ID="radioActive" runat="server" RepeatDirection="Horizontal"
                                RepeatLayout="Flow" SelectedValue='<%# Eval("IsActive") %>'>
                                <asp:ListItem Text="True" Value="True" />
                                <asp:ListItem Text="False" Value="False" />
                            </asp:RadioButtonList>
                        </EditItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

In your code behind file of Default.aspx.cs code will be such as below given

using System;
using System.Data;
 
public partial class Default : System.Web.UI.Page
{
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            var obj = new BAL();
            obj.LoadPerson(ref  GridView1);
        }
    }
    
    protected DataTable BindDropDownDepartment()
    {
        var obj = new BAL();
        return obj.LoadAll();
    }
    protected void GridViewCancelEdit(object sender, System.Web.UI.WebControls.GridViewCancelEditEventArgs e)
    {
        var obj = new BAL();
        GridView1.EditIndex =-1;
        obj.LoadPerson(ref  GridView1);
 
    }
    protected void GridViewEdit(object sender, System.Web.UI.WebControls.GridViewEditEventArgs e)
    {
        var obj = new BAL();
        GridView1.EditIndex = e.NewEditIndex;
        obj.LoadPerson(ref  GridView1);
 
    }
    protected void GridViewUpdate(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
    {
        
        GridView1.EditIndex = -1;
        var obj = new BAL();
        obj.UpdateGrid(ref GridView1, e.RowIndex);
    }
}

Now Add a class File in Your Application and write down in that below given code.

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.UI.WebControls;
 
/// <summary>
/// Summary description for BAL
/// </summary>
public class BAL
{
 
    public BAL()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    public void LoadPerson(ref GridView grd)
    {
 
        using (var objCon = new SqlConnection())
        {
            objCon.ConnectionString = ConfigurationManager.ConnectionStrings["cnGrid"].ConnectionString;
            if (objCon.State == ConnectionState.Closed)
                objCon.Open();
            using (var objAdp = new SqlDataAdapter("usp_PersonRecords", objCon))
            {
                objAdp.SelectCommand.CommandType = CommandType.StoredProcedure;
                var ds = new DataSet();
                objAdp.Fill(ds);
                grd.DataSource = ds.Tables[0];
                grd.DataBind();
            }
        }
 
    }
    public DataTable LoadAll()
    {
        dynamic objDt;
        using (var objCon = new SqlConnection())
        {
            objCon.ConnectionString = ConfigurationManager.ConnectionStrings["cnGrid"].ConnectionString;
            if (objCon.State == ConnectionState.Closed)
                objCon.Open();
            using (var objAdp = new SqlDataAdapter("usp_DeptRecords", objCon))
            {
                objAdp.SelectCommand.CommandType = CommandType.StoredProcedure;
                var ds = new DataSet();
                objAdp.Fill(ds);
                objDt = ds.Tables[0];
            }
        }
        return objDt;
    }
    public void UpdateGrid(ref GridView grd, int index)
    {
 
        var row = grd.Rows[index];
        var ddlDept = (DropDownList)row.FindControl("dropDownDept");
        var txtFname = (TextBox)row.FindControl("txtFirstName");
        var txtLname = (TextBox)row.FindControl("txtLastName");
        var isActive = (RadioButtonList)row.FindControl("radioActive");
        var chkAct = (CheckBox)row.FindControl("chkActive");
 
        var id = Convert.ToInt32(grd.DataKeys[row.RowIndex].Value);
        var FNAME = txtFname.Text.ToUpper();
        var lname = txtLname.Text.ToUpper();
        var deptID = Convert.ToInt32(ddlDept.SelectedItem.Value);
        var isactive = isActive.SelectedValue == "True" ? Convert.ToInt32(1) : Convert.ToInt32(0);
        using (var objCon = new SqlConnection())
        {
            objCon.ConnectionString = ConfigurationManager.ConnectionStrings["cnGrid"].ConnectionString;
            if (objCon.State == ConnectionState.Closed)
                objCon.Open();
            using (var cmd = new SqlCommand("usp_PersonUpdate", objCon))
            {
                cmd.CommandType = CommandType.StoredProcedure;
 
                var parm = new[]
                               {
                                   new SqlParameter("@PersonID", SqlDbType.Int, Int32.MaxValue) {Value =id},
                                   new SqlParameter("@FName", SqlDbType.VarChar, 100) {Value =FNAME },
                                   new SqlParameter("@LName", SqlDbType.VarChar, 100) {Value = lname},
                                   new SqlParameter("@DeptID", SqlDbType.Int, Int32.MaxValue) {Value =deptID},
                                   new SqlParameter("@IsActive", SqlDbType.Bit) {  Value = isactive}
                               };
                cmd.Parameters.AddRange(parm);
                cmd.ExecuteNonQuery();
                cmd.Dispose();
                LoadPerson(ref grd);
            }
        }
    }
}

Now  Run by pressing F5 remember that before run to this ensure your database and connection string  in web config file and change in that setting of your MSSQLServer

<connectionStrings>
		<add name="cnGrid" connectionString="Data Source=xxxx;Initial Catalog=dbGrid;Persist Security Info=True;User ID=xxx;Password=xxx;Pooling=False" providerName="System.Data.SqlClient"/>
</connectionStrings>

Download Url : https://docs.google.com/file/d/0B-sDsBkcsM1YODBWaVZmLTJ6YlE/edit?usp=sharing

Display Rows as Columns in Gridview in Asp.net using C#


Here I will explain how to display gridview columns as rows in asp.net or display gridview rows as columns in asp.net using C#.

If you want change columns as rows we need to write code like as shown below
 
 
<head runat=”server”>
<title>Convert Gridview Columns as Rows in Asp.net</title>
<style type=”text/css”>
body
{
font-family:Calibri;
}
.gridcss
{
background:#df5015;
font-weight:bold;
color:White;
}
</style>
</head>
<body>
<form id=”form1″ runat=”server”>
<table>
<tr>
<td><b>Normal Gridview</b></td>
<td>&nbsp;&nbsp;</td>
<td><b>Converted Gridview</b></td>
</tr>
<tr>
<td>
<asp:GridView ID=”gvnormal” runat=”server”>
<HeaderStyle BackColor=”#df5015″ Font-Bold=”true” ForeColor=”White” />
</asp:GridView>
</td>
<td>&nbsp;&nbsp;</td>
<td>
<asp:GridView ID=”gvconverted” runat=”server” OnRowDataBound=gvconverted_RowDataBound>
</asp:GridView>
</td>
</tr>
</table>
</form>
</body>

</html>

Now in code behind add following namespace references
C# Code
 
using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
After that write the following code in code behind
 
 
 
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGridviewData();
}
}
protected void BindGridviewData()
{
DataTable dt = new DataTable();
dt.Columns.Add(“UserId”, typeof(Int32));
dt.Columns.Add(“UserName”, typeof(string));
dt.Columns.Add(“Education”, typeof(string));
dt.Columns.Add(“Location”, typeof(string));
DataRow dtrow = dt.NewRow();    // Create New Row
dtrow[“UserId”] = 1;            //Bind Data to Columns
dtrow[“UserName”] = “SureshDasari”;
dtrow[“Education”] = “B.Tech”;
dtrow[“Location”] = “Chennai”;
dt.Rows.Add(dtrow);
dtrow = dt.NewRow();               // Create New Row
dtrow[“UserId”] = 2;               //Bind Data to Columns
dtrow[“UserName”] = “MadhavSai”;
dtrow[“Education”] = “MBA”;
dtrow[“Location”] = “Nagpur”;
dt.Rows.Add(dtrow);
dtrow = dt.NewRow();              // Create New Row
dtrow[“UserId”] = 3;              //Bind Data to Columns
dtrow[“UserName”] = “MaheshDasari”;
dtrow[“Education”] = “B.Tech”;
dtrow[“Location”] = “Nuzividu”;
dt.Rows.Add(dtrow);
gvnormal.DataSource = dt;
gvnormal.DataBind();
gvconverted.DataSource = ConvertColumnsAsRows(dt);
gvconverted.DataBind();
gvconverted.HeaderRow.Visible = false;
}
protected void gvconverted_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].CssClass = “gridcss”;
}
}
// This function is used to convert columns to rows
public DataTable ConvertColumnsAsRows(DataTable dt)
{
DataTable dtnew=new DataTable();
//Convert all the rows to columns
for (int i = 0; i <= dt.Rows.Count; i++)
{
dtnew.Columns.Add(Convert.ToString(i));
}
DataRow dr;
// Convert All the Columns to Rows
for (int j = 0; j < dt.Columns.Count; j++)
{
dr = dtnew.NewRow();
dr[0] = dt.Columns[j].ToString();
for (int k = 1; k <= dt.Rows.Count; k++)
dr[k] = dt.Rows[k – 1][j];
dtnew.Rows.Add(dr);
}
return dtnew;
}

Use Of PagedDataSource Class


Hello Friends Today I wil share with you new Experience which i did in my company that’s Use of Paged Data Source Class.
It’s Really a cool class and give us smart of to paging.
With Just A Smart Coding.

for This You will have to no need to take tension of Cursors ,Difficult logic’s
Simply Make a new Web Site
and
Do Following Steps of Coding as Given below.
Step 1:Make Presentation view of your page as below given
make a new web forma and place on page
1)DropDownlist(with soem entries)
2) DataList 1(with a link button in itemtemplate)
3) DataList 2(with some bind records using eval)
4) Two Link Button (previous and next)

<p>

<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head runat=”server”>
<title></title>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
<table>
<tr>
<td>
<asp:DropDownList ID=”ddlselect” runat=”server” AutoPostBack=”True”
onselectedindexchanged=”ddlselect_SelectedIndexChanged”>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
</asp:DropDownList>
<asp:LinkButton ID=”LinkButton1″ Text=”Previous” runat=”server”
onclick=”LinkButton1_Click”></asp:LinkButton>
<asp:DataList ID=”DataList2″ runat=”server” RepeatDirection=”Horizontal”
onitemcommand=”DataList2_ItemCommand”
onitemdatabound=”DataList2_ItemDataBound”
onselectedindexchanged=”DataList2_SelectedIndexChanged”>
<ItemTemplate>
<asp:LinkButton ID=”lnkbtnPaging” runat=”server” CommandArgument='<%# Eval(“PageIndex”) %>’
CommandName=”lnkbtnPaging” Text='<%# Eval(“PageText”) %>’></asp:LinkButton>
</ItemTemplate>
</asp:DataList><br />
<asp:LinkButton ID=”lnkNext”  Text=”Next” runat=”server”
onclick=”lnkNext_Click”></asp:LinkButton>
</td>
</tr>
</table>
<asp:DataList ID=”DataList1″ runat=”server”>
<ItemTemplate>
<asp:Label ID=”Label1″ runat=”server” Text='<%# Eval(“BookId”) %>’></asp:Label>
<asp:Label ID=”Label2″ runat=”server” Text='<%# Eval(“BookName”) %>’></asp:Label>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>
</p>

Step 2: Now Do coding As Given Below.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data.SqlClient;
using System.Data;
using System.Configuration;
public partial class _Default : System.Web.UI.Page
{

PagedDataSource pds = new PagedDataSource();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
}
private void BindGrid()
{
string sql = “Select * from TbBook Order By BookId”;
SqlDataAdapter da = new SqlDataAdapter(sql, ConfigurationManager.ConnectionStrings[“Or”].ConnectionString);
DataTable dt = new DataTable();
da.Fill(dt);
pds.DataSource = dt.DefaultView;
pds.AllowPaging = true;
pds.PageSize = Convert.ToInt16(ddlselect.SelectedValue);
pds.CurrentPageIndex = CurrentPage;
lnkNext.Enabled = !pds.IsLastPage;
LinkButton1.Enabled = !pds.IsFirstPage;
DataList1.DataSource = pds;
DataList1.DataBind();
doPaging();
}
public int CurrentPage
{

get
{
if (this.ViewState[“CurrentPage”] == null)
return 0;
else
return Convert.ToInt32(this.ViewState[“CurrentPage”].ToString());
}
set
{
this.ViewState[“CurrentPage”] = value;
}

}

private void doPaging()
{
DataTable dt = new DataTable();
dt.Columns.Add(“PageIndex”);
dt.Columns.Add(“PageText”);
for (int i = 0; i < pds.PageCount; i++)
{
DataRow dr = dt.NewRow();
dr[0] = i;
dr[1] = i + 1;
dt.Rows.Add(dr);
}
DataList2.DataSource = dt;
DataList2.DataBind();
}

protected void DataList2_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName.Equals(“lnkbtnPaging”))
{
CurrentPage = Convert.ToInt16(e.CommandArgument.ToString());
BindGrid();
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
CurrentPage -= 1;
BindGrid();
}
protected void lnkNext_Click(object sender, EventArgs e)
{
CurrentPage += 1;
BindGrid();
}
protected void DataList2_SelectedIndexChanged(object sender, EventArgs e)
{

}
protected void ddlselect_SelectedIndexChanged(object sender, EventArgs e)
{
CurrentPage = 0;
BindGrid();
}
protected void DataList2_ItemDataBound(object sender, DataListItemEventArgs e)
{
LinkButton lnkbtnPage = (LinkButton)e.Item.FindControl(“lnkbtnPaging”);
if (lnkbtnPage.CommandArgument.ToString() == CurrentPage.ToString())
{
lnkbtnPage.Enabled = false;
lnkbtnPage.Font.Bold = true;
}
}
}

Note :Never Forget to make table of tbbook with columns and fill dummy entries int that.
Then Press F5 and Run your web site see the handsome paging of your site.
enjoy and do programming.