TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jitendra Shekhawat
NA
1.7k
16.8k
How toshow name and insert values (name's ID ) from combobox
Mar 30 2017 1:44 AM
c# Windows Forms.
public void Load()
{
DataRow dr;
con.Open();
SqlCommand cmd = new SqlCommand("select * from city", con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
dr = dt.NewRow();
dr.ItemArray = new object[] { 0, "--Select City--" };
dt.Rows.InsertAt(dr, 0);
comboBoxunit.ValueMember = "city_ID";
comboBoxunit.DisplayMember = "city";
comboBoxunit.DataSource = dt;
con.Close();
}
Reply
Answers (
5
)
Split String in C#
Convert PDF to csv using C#