在没有数据库 / SQL的GridView中搜索项目
(ItemGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("OR Name like '{0}%'", searchBox.Text);
尝试通过使用以下代码从如何在C#Windows表单应用程序中的数据GridView中搜索?并获得了一个System.NullReferenceException:'对象引用未设置为对象的实例。'。有什么可以解决的吗?
C#非常新,需要帮助。
(ItemGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("OR Name like '{0}%'", searchBox.Text);
Trying search an item in my GridView by using the following line of code from How to search in Data gridview in C# Windows Form application? and got a System.NullReferenceException: 'Object reference not set to an instance of an object.'. Is there anything to solve this?
Very new to c# and need help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论