Hello all. I'm new to .NET and I am stuck and I just cannot getthis to work (even after much searching).
I have a listbox populated by data from an Access Database. Themanner in which I fill the listbox is as follows:
\\\\\\\\
dsClosedPos.Cle ar()
dbAdapter.Selec tCommand = New OleDbCommand
dbAdapter.Selec tCommand.Connec tion = dbConnect
dbAdapter.Selec tCommand.Comman dText = _
"SELECT * FROM qryClosedOutPos itions"
dbAdapter.Selec tCommand.Comman dType = CommandType.Tex t
dbConnect.Open( )
dbAdapter.Selec tCommand.Execut eNonQuery()
dbAdapter.Fill( dsClosedPos, "ClosedPos" )
dbConnect.Close ()
lstClosedPos.Da taSource =dsClosedPos.Ta bles("ClosedPos ").DefaultV iew
lstClosedPos.Di splayMember = "TRADED"
\\\\\\
This populates the listbox (lostClosedPos) with the results fromthe query. I am tryint to retrieve the SelectedValue when auser makes a change. However, using something along the linesof lstClosedPos.Se lectedItem.Tost ring() orlstClosedPos. SelectedValue does not work. I need the value ofthe listbox selection as a variable for a query.
Any help would be appreciated.
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>FD3bt6WkBEW vgpEvqiDgpA==</Id>