Home > C# > DataDings


DataTable dt = new DataTable();
dt.Columns.Add(“Code”, typeof(string));
dt.Columns.Add(“Name”, typeof(string));
dt.Rows.Add(“001”, “Mango”);
dt.Rows.Add(“002”, “Android”);
dt.Rows.Add(“003”, “Ginger bread”);
dt.Rows.Add(“004”, “Android 4.0”);
cboUser.DataSource = dt;
cboUser.DisplayMember = “Name”;
cboUser.ValueMember = “Code”;
txtCode.DataBindings.Add(“Text”, dt, “Code”);
txtName.DataBindings.Add(“Text”, dt, “Name”);

Categories: C#
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: