Check if a value already exist - InfoPath Dev
in

InfoPath Dev

Check if a value already exist

Last post 12-12-2005 12:55 PM by Matt Faus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-09-2005 11:46 AM

    Check if a value already exist

    My form hits an SQL database, I want to check to see if a value entered into a text box already exist in the database.

    Basically I want to make sure that the number (Member ID) is unique within the database.

    Any Ideas?
  • 12-09-2005 12:24 PM In reply to

    Re: Check if a value already exist

    Just ask the database if it has one already in there:

    var query = "SELECT id from mytable where id=" + XDocument.DOM.selectSingleNode( "//my:id" ).text;

    If it returns a row, then you know there is already an ID of that value in the database, if it doesn't you're in luck!

    Hope this helps!

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 12-12-2005 12:13 PM In reply to

    Re: Check if a value already exist

    I am not having much luck here, getting a debug error, says object expected. Thoughts?
  • 12-12-2005 12:55 PM In reply to

    Re: Check if a value already exist

    Make sure your XPath is right. Also, if you get an object expected error, maybe that means that there were no rows that matched your criteria in the database, which tells you what you need to know.

    What exactly is your error and could you give us the code snippet that is performing your query?

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.