title: Why I get the message Two-way binding requires Path or XPath.?
body: <p>I am creating a <code>TextBox</code> and a <code>TextBlock</code> at runtime and bind that to the database fields at runtime. The code is below:</p>
  
  <pre><code>LstConfigFields = dbContext.ConfigFields.Where(c =&gt; c.ConfigId == this.Uid).ToList();
  foreach (ConfigField rec in LstConfigFields)
  {
      TextBlock TBlock = new TextBlock();
      TBlock.Text = rec.TextBlockText;
  
      TextBox TBox = new TextBox();                
      TBox.SetBinding(TextBox.TextProperty,new Binding(rec.DatabaseField));
  
      if ((bool)rec.IsVisible)
      {
          stackPanel1.Children.Add(TBlock);
          stackPanel1.Children.Add(TBox);
      }
  }
  </code></pre>
  
  <p>But I am getting this message :</p>
  
  <blockquote>
    <p>Two-way binding requires Path or XPath.</p>
  </blockquote>
  
  <p>Where am I going wrong?</p>