System.ArgumentNullException:'值不能为空。 (参数‘来源’)”
这是我的一个旧项目。我已经一段时间没有打开了。据我所记得的,它的工作正常。但是今天,当我开放它时,它停止了工作。我没有更改一行代码。它只是停止工作(构建良好,但不在之后开始)。经过一整夜的挫败感,我发现了为什么它不启动而无法想象或找到任何可能的解决方案的原因,因为它表现得很好,但突然它决定停止工作。 请帮助:)
https://i.sstatic.net/rwkmg.png” alt =“我不知道为什么现在显示此例外。
This is an old project of mine. i haven't opened it for some time. As far as i remember it was working perfectly fine. but today when i opend it it stopped working. i haven't change a single line of code. it just stopped working(it builds just fine but dont start after). After a full night of frustration i found the reason of why its not starting but couldn't imagine or find any possible solution, cause it was eorking perfectly fine but suddenly it decided to stop working.
Please help :)
i swear i haven't changed a single line of code. not even a coma.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为您使用空的
searchKey
调用了PopulateGridViewEmployee
,该参数是设置为 Null 的可选参数。因此,您将收到 System.ArgumentNullException
要修复它,请将可选参数更改为空字符串:
PopulateGridViewEmployee(string searchKey = "")
It's because you have called
PopulateGridViewEmployee
with an emptysearchKey
which is an Optional Argument set to Null.Hence you're getting System.ArgumentNullException
To fix it change the optional argument to have an empty string:
PopulateGridViewEmployee(string searchKey = "")