0

Hi,

I created a combobox and binded it with MS access table using following code:

this->oleDbDataAdapter1->SelectCommand->CommandText="SELECT DISTINCT Profile_Name FROM Profiles";
this->oleDbDataAdapter1->Fill(dataSet1,"Profiles");
DataTable^dt= dataSet1->Tables["Profiles"];
comboBox1->DataSource= dt;
comboBox1->DisplayMember = "Profile_Name";

I got the correct profile name I needed in the combobox. I tried it using textbox,

textBox1=comboBox1->SelectedItem->ToString();

However,it always return me "System.Data.DataRowView". How can I get the correct selected item?

Forgive me for keep spamming question as I m really working under very limited time constraint. Thanks in advance.

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by dittukumar
0

Haven't worked with forms etc for a while,so I might be wrong, but: textBox1->[b]Text[/b]=comboBox1->SelectedItem->ToString(); should work.

0

Hey even I need this. I have a combox which I binded with particular datasource. Now I want any item`s name. comboBox.items[1].Tostring() is no working.. its giving systme.data.datarowview ...
please anyone help me..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.