ribbysmurf
Member
- Joined
- Jul 27, 2003
- Messages
- 9
below is my source code.. im using datasouce to bind data to my combo box, the problem is that after bind to my combo box. i can get the text using combobox1.item(index)... can somebody pls help me?
the error msg is
An unhandled exception of type System.ArgumentException occurred in microsoft.visualbasic.dll
Additional information: Argument Prompt cannot be converted to type String.
pls..help me..thankss
Code:
path = Application.StartupPath + "\data.mdb"
Creating connection and command sting
sqlStr = "SELECT * FROM problem"
Create connection object
Dim connp As OleDbConnection = New OleDbConnection(conStr)
Create data adapter object
Dim dap As OleDbDataAdapter = New OleDbDataAdapter(sqlStr, conn)
Create a dataset object and fill with data using data adapters Fill method
Dim dsp As DataSet = New DataSet
dap.Fill(dsp, "main")
Attach datasets DefaultView to the datagrid control
Dim dvp As DataView = dsp.Tables("main").DefaultView
combobox1.DataSource = dvp
combobox1.DisplayMember = "Problem"
msgbox (combobox1.item(0)) <-- problem here
An unhandled exception of type System.ArgumentException occurred in microsoft.visualbasic.dll
Additional information: Argument Prompt cannot be converted to type String.
pls..help me..thankss
Last edited by a moderator: