Post edited by moderator XIII: don't use [ code ] tags as this messes up the html.
Hi
I am trying to retrieve some values from a database table based on a drop down list selection.
This is my code:
try
{
dsPartsListTableAdapters.PartsListTableAdapter partsAdaptor = new dsPartsListTableAdapters.PartsListTableAdapter();
DropDownList myList = (DropDownList)fvSloParts.FindControl("DropDownList1");
int number = Convert.ToInt32(myList.SelectedValue);
dsPartsList.PartsListDataTable part = partsAdaptor.GetPartByPartID(number);
string partCost;
partCost = Convert.ToString(part.partCostColumn);
TextBox myText = (TextBox)fvSloParts.FindControl("cost_AtTimeTextBox");if (myText != null)
{
myText.Text = partCost.ToString();
}
}
catch (Exception ex)
{
// error coding here
Tools.Log("buttGetPart_Click", ex);
}
After execution, my screen displays the word "partCost" in the field "cost_AtTimeTextBox" instead of its value. How do I get it to display the value?
Stapes