title: databinding issue asp.net dropdown list
body: <p>Im trying to bind my drop down list, i think is beacuse my asp code on the front end is not bound somehow</p>
  
  <p>aspx</p>
  
  <pre><code>        &lt;asp:Label ID="Label2" runat="server" /&gt;
          &lt;asp:DropDownList Width="150px" ID="ddLocation" runat="server" 
              AppendDataBoundItems="True"
              DataTextField="Name" 
              DataValueField="Name" AutoPostBack="True" &gt;
  
          &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>c# code </p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (!Page.IsPostBack)
      {
          Label0.Text = "Specialities";
          Label1.Text = "Category";
          Label2.Text = "Locations";
          ddSpec.Items.Insert(0, new ListItem("Select a spec", "0"));
          ddCategory.Items.Insert(0, new ListItem("Select a Category", "0"));
          ddLocation.Items.Insert(0, new ListItem("&lt;Select a Location&gt;", "0"));
          populattePage();
  
      }
  }
  
  
  public void populattePage()
  {
       getlocation();
       // getCategory()
  }
  
  
  public static void getlocation()
  {
  
     DataClasses_DataContext dc = new DataClasses_DataContext();
  
      List&lt;string&gt; locations = (
          from a
              in dc.Locations
          select a.Name).ToList();
  
      DropDownList ddLocation = new DropDownList();
  
      ddLocation.DataSource = locations;
  
      ddLocation.DataValueField = "ID";
      ddLocation.DataTextField = "Name";
  
      ddLocation.SelectedIndex = 0;
      ddLocation.DataBind();
  
  }
  </code></pre>
  
  <p>I now have the Error """"DataBinding: 'System.String' does not contain a property with the name 'Name'."""  the code in the """page load""" class adds items to the drop downs however when i call the get locations class I get this error, Please help thanks in advance </p>