You can't cast an object to something that it isn't. You can only cast an object to it's actual class, any of it's base classes, or any of the interfaces that it implements.
C# is type safe, so the object contains information about it's actual type. When you do a cast, you cast the reference, but the object still remains the same type. Therefore, when you cast the DataTable reference to object, you get an object reference pointing to a DataTable object. You can't then cast this to msdatasrc.DataSource, as the actual type of the object does not inherit that class.
If the control can't use a DataTable as data source, you have to copy the data from the DataTable into something that the control can use.
Despite everything, the person most likely to be fooling you next is yourself.
My goal is to have a combo box for genders. I need the combo box to display the selected gender. Currently I have a class that has one of it's properties as gender. 1 is supposed to be male and 2 is female. However I am willing to do it however is best. I would like to incorporate binding since that is how I am doing the rest of my app. i.e. text boxes and datepickers etc
My problem is that the only thing I really know how to do in data binding is to drag an item from the data sources menu to a text box or a date time picker. Here the most important thing is the selection be the selection that has been chosen in the object. Ideally I can just use objects but if I have to I can go with xml, but either way I really need some direction.
In the most simplest form, I want a combobox that will load on a form that will have have a item selected already. In other words lets say it's a male. So in my object it will have gender equal to 1. I want my form to know that when gender = 1, then it will automatically select male. I want to use data binding because thats how I have the rest o my project set up, and I feel that I will just be asking for trouble, if I use databinding for only half. I already know I can do it with if statements.