maryam Posted August 20, 2003 Posted August 20, 2003 hi i have a combobox with below code: CBCustomer.DataSource = DS.DSFactor.Customer CBCustomer.DisplayMember = "Custom_Name" CBCustomer.ValueMember = "id" but when i use TextBox5.Text = CBCustomer.SelectedValue.ToString() the value is not equl by the id field in my table what should i do? :confused: thanks Quote
Administrators PlausiblyDamp Posted August 20, 2003 Administrators Posted August 20, 2003 What value were you expecting and what value did you get instead? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
maryam Posted August 20, 2003 Author Posted August 20, 2003 hi for example i have below records id custom_name ------ ------------------- 1 one 2 two 3 three and my selectedtem is "one" but the selectedvalue=3 and if for example my selecteditem=two then selectedvalue=1 and so on i can not access to my id from the combobox.selectedvalue Quote
Administrators PlausiblyDamp Posted August 20, 2003 Administrators Posted August 20, 2003 I'll have a proper look later today. Not near a computer with VS as the moment. In your example what are the objects DS, DSFactor and Customer? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
maryam Posted August 20, 2003 Author Posted August 20, 2003 hi ds is instance of Component Class dsfactor is instance of dataset and customer is my table in dataset and custom_name and id are fields of customer table. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.