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
JEFFREY STEWART
NA
8
508
Binding 2 sets of combo boxes
Mar 19 2018 5:29 PM
i am trying to bind 2 sets of combo boxes to input into a database, the first set will work if i delete the second set , but i cannot get both to work at the same time. Please Help.
private void Form1_Load(object sender, EventArgs e)
{
System.Data.DataTable dt = new System.Data.DataTable();
System.Data.DataColumn dc1 = new System.Data.DataColumn("AccountName");
System.Data.DataColumn dc2 = new System.Data.DataColumn("AccountNumber");
dt.Columns.Add(dc1);
dt.Columns.Add(dc2);
dt.Rows.Add("Cash", "0100");
dt.Rows.Add("Accounts Recievable", "0200");
dt.Rows.Add("Account Payable", "0300");
dt.Rows.Add("Equipment", "0400");
dt.Rows.Add("Supplies", "0500");
dt.Rows.Add("Notes Payable", "0600");
dt.Rows.Add("Service Revenue", "0700");
dt.Rows.Add("Wages Expense", "0800");
dt.Rows.Add("Utilities", "0900");
dt.Rows.Add("Unearned Income", "1000");
AccountNamecomboBox1.DataSource = dt;
AccountNamecomboBox1.DisplayMember = "AccountName";
AccountNamecomboBox1.ValueMember = "AccountNumber";
AccountNumbercomboBox1.DataSource = dt;
AccountNumbercomboBox1.DisplayMember = "AccountNumber";
AccountNumbercomboBox1.ValueMember = "AccountName";
System.Data.DataTable dt1 = new System.Data.DataTable();
System.Data.DataColumn dc3 = new System.Data.DataColumn("AccountName1");
System.Data.DataColumn dc4 = new System.Data.DataColumn("AccountNumber1");
dt1.Columns.Add(dc3);
dt1.Columns.Add(dc4);
dt1.Rows.Add("Cash", "0100");
dt1.Rows.Add("Accounts Recievable", "0200");
dt1.Rows.Add("Account Payable", "0300");
dt1.Rows.Add("Equipment", "0400");
dt1.Rows.Add("Supplies", "0500");
dt1.Rows.Add("Notes Payable", "0600");
dt1.Rows.Add("Service Revenue", "0700");
dt1.Rows.Add("Wages Expense", "0800");
dt1.Rows.Add("Utilities", "0900");
dt1.Rows.Add("Unearned Income", "1000");
AccountNamecomboBox2.DataSource = dt1;
AccountNamecomboBox2.DisplayMember = "AccountName1";
AccountNamecomboBox2.ValueMember = "AccountNumber1";
AccountNumbercomboBox2.DataSource = dt1;
AccountNumbercomboBox2.DisplayMember = "AccountNumber1";
AccountNumbercomboBox2.ValueMember = "AccountName1";
Reply
Answers (
2
)
Date picker select only date in window application
i want to show all datagridview in RDLC report