用户代码未处理空引用异常 [英] Null reference exception unhandled by user code
本文介绍了用户代码未处理空引用异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
getdetails.Parameters.Add("@S_ID", SqlDbType.Int).Value = lbl.Text
getdetails.Parameters.Add("@Name", SqlDbType.VarChar).Value = txt1.Text
getdetails.Parameters.Add("@Subject", SqlDbType.VarChar).Value = txt2.Text
getdetails.Parameters.Add("@Mark1", SqlDbType.VarChar).Value = txt3.Text
getdetails.Parameters.Add("@Mark2", SqlDbType.VarChar).Value = txt4.Text
在本节中,您好(lbl.text)我收到用户代码未处理的空引用异常//",这表示
hi in this section(lbl.text) i am getting "Null reference exception unhandled by user code//" whay it means
推荐答案
在lbl
中签入为null在那个时候.
^ ]了解更多信息.
Check inlbl
is null at that point.
Google[^] for more.
您必须在此处转换为Int类型.
You have to convert to Int type there.
这篇关于用户代码未处理空引用异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文