开发者

Cast Bindingsoure.Current to POCO

开发者 https://www.devze.com 2022-12-18 22:29 出处:网络
I have a sqldatareader that gets assigned to a bindingsource and a datagridview datasource to that. When I look at the type of Bindingsoure.Current its a DataRecordInternal.How can I cast that to my

I have a sqldatareader that gets assigned to a bindingsource and a datagridview datasource to that.

When I look at the type of Bindingsoure.Current its a DataRecordInternal. How can I cast that to my POCO?

Will I have to manually work out which fields in the Current object relate to my POCO. I could do it through my POCO and just tak开发者_运维技巧e the Grid.Cells[0]["ID"] and populate it that way but that is obviosuly another hit to the DB.

0

精彩评论

暂无评论...
验证码 换一张
取 消