Query Trouble - Need to return largest element from a column to one field

N

n.repole

Having a bit of a problem with a pretty simple task, that
unfortunately I haven't been able to find a clear example of to work
off of. I have a database with a table called Requests in it. In
requests, there's a column called Alpha, which is stored in
alphabetical order (so that Alpha in the last row of the table is
always the biggest Alpha in the table). I need to retrieve the last
record of Alpha and store it in my Last field. Now, if I run some
simply query code like this:

XDocument.QueryAdapter.Command = "SELECT Alpha FROM Requests ORDER BY
Alpha DESC";
XDocument.Query();
XDocument.DOM.selectSingleNode( "/dfs:myFields/my:Last" ).text =
XDocument.DOM.selectSingleNode( "/dfs:myFields/dfs:dataFields/
d:Requests/@Alpha" ).text;


I can accomplish what I want, however when I do this all the other
fields get locked up, and no data can be input. How do I solve such an
issue? I've read http://www.infopathdev.com/forums/t/4367.aspx?PageIndex=2
and am still left confused.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top