Hi
I have below data . In Dropdown it is showing System.Data.DataRowView
private void GetLocation()
{
try
{
con.ConnectionString = ConfigurationManager.ConnectionStrings["cnn_Live"].ConnectionString; ;
SqlCommand cmd = new SqlCommand("select docentry,locationname from Location", con);
cmd.CommandType = CommandType.Text;
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows.Count > 0)
{
ddlLocation.DataSource = dt;
ddlLocation.DataBind();
con.Close();
}
}
catch (Exception ex)
{
ShowMessage("", ex.Message, "error");
}
}
Thanks