|
-
Jul 31st, 2007, 02:36 AM
#1
Thread Starter
Lively Member
multiple comboboxes binded with same dataset
Hi
i am having 2 combo boxes binded to same dataset and different columns.but changing in one combo is getting changed with another combo too
objCon = new SqlConnection("server=server;database=Master;uid=sa;pwd=123@esn;");
objAdapter = new SqlDataAdapter("select * from users", objCon);
ds = new DataSet();
objAdapter.TableMappings.Add("Table", "Users");
objAdapter.TableMappings.Add("Tables", "Users");
objAdapter.Fill(ds);
comboBox1.DataSource = ds;
comboBox1.DisplayMember = "users.Role".Trim();
comboBox2.DataSource = ds;
comboBox2.DisplayMember = "users.UserName".Trim();
its the code i implemented. But changing Role in combo1 results in change in combo2
i used c# 2005 windows application
Thanks and Regards
Vinay Kumar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|