how to locate a current(selected) row in a repeating table - InfoPath Dev
in

InfoPath Dev

how to locate a current(selected) row in a repeating table

Last post 03-04-2012 09:16 PM by rupal. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-02-2012 04:47 AM

    • rupal
    • Not Ranked
    • Joined on 03-02-2012
    • Posts 2

    how to locate a current(selected) row in a repeating table

    Hello,

     I have a problem in my infopath (2010) database template form. Let me explain the scenario first,

    I have a repeating table, i am trying to get the value of selected row from repeating table.

    e.g i want to delete a 7th row in the repeating table. 

    i gone through so many blogs, from where i came to know that, use a e.source.

    i done like wise, my code is :

    public void btnDelete_Clicked(object sender, ClickedEventArgs e)

    {

    XPathNavigator dom = e.Source.CreateNavigator();

    XPathNodeIterator xnode = dom.Select("/dfs:myFields/dfs:dataFields/d:Hdr", NamespaceManager);

    string Tender_Number = xnode.Current.SelectSingleNode("/dfs:myFields/dfs:dataFields/d:Hdr/@Tender_Number", NamespaceManager).Value;

     

    AdoQueryConnection connection =(AdoQueryConnection)DataConnections["Main connection"];

     

     

     

     

     

    dom.DeleteSelf();

    // Retrieve the connection to the database table

    string originalCommand = connection.Command;

    // Execute the stored procedure

    connection.Command = "EXEC SP_Hdr_delete '" + Tender_Number + "' ";

    connection.Execute();

     

    // Restore the statement of the Command property to its original value

    connection.Command = originalCommand;

     

     

    }

     

    here my backend is SQL server 2008. i want to delete the same row evan from the database. but it deleted the first row from the database. i am not able to locate the selected row.

    the Delete button present in a repeating table.

    Quick reply on this issue will be a great help to me.

    Thanks in Advance,

    Rupal

     

  • 03-02-2012 05:34 AM In reply to

    Re: how to locate a current(selected) row in a repeating table

    qRules has a delete command which can easily delete a row in a repeating table without writing any code.  For more info: http://www.qdabra.com/en/products/qRules_overview.aspx
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 03-04-2012 09:16 PM In reply to

    • rupal
    • Not Ranked
    • Joined on 03-02-2012
    • Posts 2

    Re: how to locate a current(selected) row in a repeating table

    Is it possible with qRules that i can able to update the records in database(SQL SERVER 2008) also.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.