Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DropDownList

DropDownList

Scheduled Pinned Locked Moved C#
designhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    minniemooo
    wrote on last edited by
    #1

    Hi, I get the following error: 'System.Web.UI.WebControls.DropDownList' does not contain a definition for 'DatatValueField' My code : string sqlStmt = null; sqlStmt = "GetProjest";//stored proc SqlCommand cmd = new SqlCommand(); cmd.CommandText = sqlStmt; cmd.CommandType = CommandType.StoredProcedure; SqlDataReader sqlReader = cmd.ExecuteReader(); if(sqlReader.HasRows) { ProjectidList.DataSource = sqlReader; ProjectidList.DataTextField = "Project_ID"; ProjectidList.DatatValueField = "Project_ID"; ProjectidList.DataBind(); }

    A 1 Reply Last reply
    0
    • M minniemooo

      Hi, I get the following error: 'System.Web.UI.WebControls.DropDownList' does not contain a definition for 'DatatValueField' My code : string sqlStmt = null; sqlStmt = "GetProjest";//stored proc SqlCommand cmd = new SqlCommand(); cmd.CommandText = sqlStmt; cmd.CommandType = CommandType.StoredProcedure; SqlDataReader sqlReader = cmd.ExecuteReader(); if(sqlReader.HasRows) { ProjectidList.DataSource = sqlReader; ProjectidList.DataTextField = "Project_ID"; ProjectidList.DatatValueField = "Project_ID"; ProjectidList.DataBind(); }

      A Offline
      A Offline
      Andrei Ungureanu
      wrote on last edited by
      #2

      This cannot be real....Read the error, it tells you exactly what's wrong. You misspelled the property. There is an extra "t". What you wrote

      ProjectidList.DatatValueField = "Project_ID";

      What you should have written:

      ProjectidList.DataValueField = "Project_ID";

      I will use Google before asking dumb questions

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups