protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Client_Combo(); } protected void Client_Combo() { Client objClient = new Client(); drpClient.DataSource = objClient.GetGridValues(); drpClient.DataValueField= "Id"; drpClient.DataTextField = "Name"; drpClient.DataBind(); } the saved value i am retrieving from table and assigning to DataTable from that i want to assign dropdownlist for that i writen code like below BLL.Transaction objTrans = new BLL.Transaction(); DataTable dtTrans = null; dtTrans = objTrans.GetTransactionValues(SelectedID); DTO.TransactionInfo TransInfo = new DTO.TransactionInfo(); if (dtTrans.Rows[0]["Client"].ToString() != null) { drpClient.Items.FindByValue(dtTrans.Rows[0]["Client"].ToString()).Selected = true; }
drpClient.Items.FindByValue(dtTrans.Rows[0]["Client"].ToString()
null
dtTrans.Rows[0]["Client"].ToString()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)