Dim getCustomers As String = "select * from rmm_customers"
Dim ds As New DataSet
Dim cmd As New OracleCommand(getCustomers, conn)
Dim da As New OracleDataAdapter(cmd)
But I get an excpetion at : " cbCustomer.ValueMember = "custmr_code" "
I can't know what is the exception,because it's says "there is an exception at the follwoing line,but can't display the message because NETCE 3.5 is not installed", something like that.
Everything is correct,as far as I know. Please anyone has an idea what throws this exception?
Unfortunately yor error message is not displayed, very bad. A common eror here is custmr_code is not a part of datatable. Just check what is the exact column name in your rmm_customers table and copy and paste the same here. Also check if your query returns
any value at all? If it returns zero records, try adding one blank record to it and then set the data source.
Regards,
Snigdha
Please Mark as Answer if my reply helped you.
I stated the common errors, but withuot knowing the exact error, it's difficult to tell any solution. Can't you run this code somewhere where it will show the error? That would bring you the solution. DropDownFields have some binding property, which should
be set true. Have you checked that?
Regards,
Snigdha
Please Mark as Answer if my reply helped you.
moe_caruso
Member
9 Points
41 Posts
Problem in populating a combox from a dataset? Please help me!
Nov 20, 2012 06:23 AM|LINK
Hello guys ,
I am trying to populate a combox from a dataset.
I use the followong code :
Dim getCustomers As String = "select * from rmm_customers"
Dim ds As New DataSet
Dim cmd As New OracleCommand(getCustomers, conn)
Dim da As New OracleDataAdapter(cmd)
da.Fill(ds, "rmm_customers")
cbCustomer.DataSource = ds
cbCustomer.ValueMember = "custmr_code"
cbCustomer.DisplayMember = "custmr_name"
But I get an excpetion at : " cbCustomer.ValueMember = "custmr_code" "
I can't know what is the exception,because it's says "there is an exception at the follwoing line,but can't display the message because NETCE 3.5 is not installed", something like that.
Everything is correct,as far as I know. Please anyone has an idea what throws this exception?
Thank you very much.
sargamlucy
Member
559 Points
164 Posts
Re: Problem in populating a combox from a dataset? Please help me!
Nov 20, 2012 06:35 AM|LINK
Unfortunately yor error message is not displayed, very bad. A common eror here is custmr_code is not a part of datatable. Just check what is the exact column name in your rmm_customers table and copy and paste the same here. Also check if your query returns any value at all? If it returns zero records, try adding one blank record to it and then set the data source.
Regards,
Snigdha
Please Mark as Answer if my reply helped you.
moe_caruso
Member
9 Points
41 Posts
Re: Problem in populating a combox from a dataset? Please help me!
Nov 20, 2012 08:36 AM|LINK
The query does return data. I have checked ds.rows.count, and it returned the right number.
I am also sure of the column name in the database,so there is nothing wrong.
any more suggestions? I am very desperate, I can't solve it.
sargamlucy
Member
559 Points
164 Posts
Re: Problem in populating a combox from a dataset? Please help me!
Nov 20, 2012 01:17 PM|LINK
I stated the common errors, but withuot knowing the exact error, it's difficult to tell any solution. Can't you run this code somewhere where it will show the error? That would bring you the solution. DropDownFields have some binding property, which should be set true. Have you checked that?
Regards,
Snigdha
Please Mark as Answer if my reply helped you.
roopeshreddy
All-Star
20155 Points
3328 Posts
Re: Problem in populating a combox from a dataset? Please help me!
Nov 20, 2012 01:52 PM|LINK
Hi,
Looks like it's an application for Windows Handheld device! Is that right?
If yes, did you tried caching the exeption using Exception class?
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
moe_caruso
Member
9 Points
41 Posts
Re: Problem in populating a combox from a dataset? Please help me!
Nov 20, 2012 02:09 PM|LINK
Yes it's a windows mobile application. Finally I have found the solution, it shoud be like this :
cbCycle.DataSource = ds.Tables("rmm_customer_cycles")
cbCycle.ValueMember = ds.Tables(0).Columns(0).ColumnName
cbCycle.DisplayMember = ds.Tables(0).Columns(0).ColumnName
instead of :
cbCycle.DataSource = ds
cbCycle.ValueMember = "custmr_code"
cbCycle.DisplayMember = "custmr_name"
Thanks for help anyway !