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 tablestring originalCommand = connection.Command;
// Execute the stored procedureconnection.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