 |
| General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 1st, 2004, 03:42 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Value in Combobox
Hello,
How can I refer to value in combobox. Which's property, I can use.
Please give me a sample.
Thanks
|
|

October 1st, 2004, 03:45 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
|
|
User the SelectedValue property
Regards
Ganesh
|
|

October 1st, 2004, 03:58 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks
I try to use the SelectedValue but it's error like the follow massage.
[u]A first chance exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Specified cast is not valid.</u>
and
[u]A first chance exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from type 'DataRowView' to type 'Integer' is not valid.</u>
If you know why, please tell me more
Thanks
|
|

October 1st, 2004, 04:06 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
|
|
can u send me the code which you have written. It seems you are assigning it to a wrong datatype. This is not the error when u read the SelectedValue Property
Regards
Ganesh
|
|

October 1st, 2004, 04:21 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi;
I write this code in my UI in order to pass value to bussiness object.
Me.oBirthDistrict.GetDistrictsByProvinceIdentity(M e.cboBirthProvince.SelectedValue)
Regards
pasert
|
|

October 1st, 2004, 04:53 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am sorry, the reply bebore not complete
The first error occur from this code.
Me.oBirthDistrict.GetDistrictsByProvinceIdentity(M e.cboBirthProvince.SelectedValue)
The second error occur from this code.
Me.oBirthDistrict.GetDistrictsByProvinceIdentity(C Type(Me.cboBirthProvince.SelectedValue, Integer))
regards
prasert
|
|

October 1st, 2004, 05:02 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
|
|
what do u have as the values of the ListItems? are they strings or Integer strings?
Regards
Ganesh
|
|

October 1st, 2004, 05:13 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello,
The Values of the ListItems are Integer
Regards
Prasert
|
|

October 1st, 2004, 05:17 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello,
The Values of the ListItems(source value) are Integer but the displays(source display) in combobox are String.
Regards
Prasert
|
|

October 1st, 2004, 05:38 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
|
|
what does your GetDistrictsByProvinceIdentity method accept as a parameter? if it accepts an integer, you should cast the SelectedValue as integer before passing
Regards
Ganesh
|
|
 |