"当DataSource属性设置项集合不能被修改" [英] "Items collection cannot be modified when the DataSource property is set."

查看:186
本文介绍了"当DataSource属性设置项集合不能被修改"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有与通过表单文件添加到一个txt文件,但这个问题并没有说明什么的fstream所以我认为它没有处理它,但我不知道一个程序这个问题是什么。这个问题意味着

  lstEmployees.Items.Add(没有找到记录。); 


解决方案

该错误消息告诉我们,你已经设置了 DataSource属性的lstEmployees。
所以去lstEmployees属性和删除数据源 - 或者,如果你想保留的数据源,鸵鸟政策尝试添加自己的项目lstEmployees,因为它不需额外接受<。 / p>

Having this issue with a program that adds files through a form to a txt file but the issue doesn't say anything about Fstream so i'm thinking it doesn't have to deal with it but i'm not sure what this problem means.

lstEmployees.Items.Add("No records found.");

解决方案

The error message tells us that you have set the "DataSource property" on "lstEmployees". So go to "lstEmployees" properties and remove the DataSource - or if you want to keep the DataSource, don´t try to add "your own" items to "lstEmployees", as it won´t be accepted.

这篇关于&QUOT;当DataSource属性设置项集合不能被修改&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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