Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

assign datasource to dropdownlist in c#

cmd.CommandText = " Select * From GetUsersID";
        cmd.Connection = conn;
        conn.Open();
        DataTable dt  = new DataTable();

        dt.Load(cmd.ExecuteReader());
        conn.Close();

        DropDownList1.DataSource = dt;
        DropDownList1.DataTextField = "Name";
        DropDownList1.DataValueField = "ID";
        DropDownList1.DataBind(); 
Comment

PREVIOUS NEXT
Code Example
Csharp :: Set value into lookup field in console app using dynamic CRM 365 
Csharp :: unity if or 
Csharp :: c# socket receive 
Csharp :: how to convert a bitmap to a base64 string c# xamarin universal 
Csharp :: windows forms iterate through all controls 
Csharp :: axwmp balance c# 
Csharp :: UnityEngine.Transform.get_position () (at <a0ef933b1aa54b668801ea864e4204fe:0) Gamekit3D.MeleeWeapon.BeginAttack (System.Boolean thowingAttack) 
Csharp :: vuln.c nc mercury.picoctf.net 59616 
Csharp :: vs code explorer font size 
Csharp :: c# how to output in between 0 - 100 in an int array 
Csharp :: application server types in .net 
Csharp :: socket would block error c# 
Csharp :: c# open file in default program 
Csharp :: remove backcolor c# 
Csharp :: how to draw a rectangle in monogame 
Csharp :: game object set exact position unity 
Csharp :: get the current directory in unity 
Csharp :: iterate through xpdictionary devexpress 
Csharp :: convert int to string in linq query c# 
Csharp :: unity set sprite transparency 
Csharp :: unity agent bake not derecting mesh 
Csharp :: if cluse in class in vue 
Csharp :: c# sql duplicate key exception 
Csharp :: how to add reference to rigidbody 2d 
Csharp :: what is data encapsulation c# 
Csharp :: c# choose first n elements from list 
Csharp :: c# datetimepicker set weeks after today 
Csharp :: C# get string as stream 
Csharp :: content type application/json c# 
Csharp :: unity how get random color to material 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =