Search code examples
vb.netentity-frameworkbindingsource

How to get the Data type of items in an empty Bindingsource?


I have a bindingsource bound to an entity.

When the bindingsource has at least one element , I can get the items type with :

MyBindingSource.Current.GetType

But how can I do in the case when bindingsource is empty ?

Thank you !

Update

I have used :

MyBindingSource.GetItemProperties(Nothing)(0).ComponentType

but even this method doesn't work when bindingsource has no items.


Solution

  • This is working on a bindingsource that has no items :

    MyBindingSource.DataSource.UnderLyingSystemType.Name