将数据源重新分配给BindingSource时出错 [英] Error while reassigning DataSource to BindingSource

查看:72
本文介绍了将数据源重新分配给BindingSource时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的应用程序中,我正在使用BindingSource.
我正在使用像这样的IBindingList对象将DataSource分配给该BindingSource:

Hi All,

In my application, i am using a BindingSource.
I am assigning DataSource to that BindingSource using IBindingList object like this :

objBindingSource.DataSource = objIBindingList



第一次工作正常,当我尝试执行相同的stmt时出现问题.再次(我的意思是此stmt.所在的相同方法).

尝试执行第二次时显示此错误:



It is working fine for the first time, the problem occurs when i try to execute same stmt. again( I mean same method in which this stmt. resides).

It is showing this error when trying to execute 2nd time:

object does not match target type



谁能告诉我为什么会这样吗?

谢谢,
Nagendra.



Can anybody tell me why this is happening?

Thanks,
Nagendra.

推荐答案

分配不应发生两次.而是尝试在对象上实现INotifyPropertyChanged.
The assignment should not occur twice. Instead try implementing the INotifyPropertyChanged on the object.


这篇关于将数据源重新分配给BindingSource时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆