简体   繁体   中英

Call an infopath textfield in codebehind using c#

I have 2 textfields:

Textfield 1 - the user types an input number

Textfield 2 - You get the result from what the user typed in the first textfield.

    public void Txb1_Changed(object sender, XmlEventArgs e)
    {
        AdoQueryConnection conn = (AdoQueryConnection)(this.DataConnections[@"Data Source=****;Initial Catalog=****;Integrated Security=True;Trusted_Connection=True"]);
        string origCommand = "Select Name from TableUsers where ID = '"+"TexField.Text"+"'";
        conn.Command = origCommand;
        conn.Execute();
        TextField2.Text = Database result; //here i want the result

    }

My problem is I don't know how to call textfield1 or textfield2 from my infopath form in order to manipulate them. Both Textfield are under MyFields form and i already made an sql connection which is working well. Hope someone can help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM