title: Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
body: <p>I have to display values into text box while selecting drop down list. I have use data set to get values from db. The code is given below. Give me a proper solution. Thank you.</p>
  
  <p>Code:</p>
  
  <pre><code> protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
       {
          DataSet1TableAdapters.TextBoxTableTableAdapter tx;
          tx = new DataSet1TableAdapters.TextBoxTableTableAdapter();
          DataTable dt = new DataTable();
          dt = tx.GetstudData(int.Parse(DropDownList1.SelectedValue));
          foreach (DataRow row in dt.Rows)
             {
             TextBox1.Text = (row["FirstName"]); // error shown here
             TextBox2.Text = (row["SecondName"]); // error shown here
             }
       }
  </code></pre>
  
  <p>The dt contains First Name and Last Name values. While selecting student ID the appropriate value shoud be shown in text box1 and textbox 2.</p>
  
  <p>Sql query:</p>
  
  <pre><code>SELECT FirstName, SecondName FROM TextBoxTable WHERE (Id = @Id)
  </code></pre>
  
  <p>Source:</p>
  
  <pre><code>&lt;div&gt;
  &lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"&gt;
  &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;asp:TextBox ID="TextBox2" runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Data base:</p>
  
  <p><img src="https://i.stack.imgur.com/Ngkj1.jpg" alt="enter image description here"></p>