Skip to content

Instantly share code, notes, and snippets.

@m8s00
Last active February 17, 2017 05:22
Show Gist options
  • Save m8s00/812d6a286dc24a39354ea2eef29494cc to your computer and use it in GitHub Desktop.
Save m8s00/812d6a286dc24a39354ea2eef29494cc to your computer and use it in GitHub Desktop.
C# DropDownList DataBind Memo
DropDownList ddl = New DataTable();
DataTable dt = New DataTable();
string sql = null;
sql = "SELECT COL1, COL2, COL3 FROM DUAL";
dt = SelectCommand(sql); //Run SQL
ddl.DataSource = dt;
ddl.DataValueField = "COL1";
ddl.DataTextField = "COL3";
ddl.DataBind();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment