我真的不知道处理了我真的不知道处理了
c_a_3();
我真的不知道怎么办了
Public Class formdenglu
Inherits System.Windows.Forms.Form
Private Function ExecuteSQL(ByVal SQL As String) As String
Dim con As New SqlConnection( Server=.;Integrated Security=SSPI;Database=Marcket )
Dim command As New SqlComman...
我真的不知道处理了
c_a_3();
我真的不知道怎么办了
Public Class formdenglu
Inherits System.Windows.Forms.Form
Private Function ExecuteSQL(ByVal SQL As String) As String
Dim con As New SqlConnection( Server=.;Integrated Security=SSPI;Database=Marcket )
Dim command As New SqlCommand
command.Connection = con
command.CommandText = SQL
Try
con.Open()
Dim str As String = command.ExecuteScalar()
Return str
Catch ex As Exception
MsgBox(ex.ToString)
Finally
con.Close()
End Try
Return Nothing
End Function
出现错误:
未处理的“System.NullReferenceException”类型的异常出现在 登陆界面.exe 中。
其他信息:
未将对象引用设置到对象的实例。
------解决
--------------------------------------------------------
Command.ExecuteScale().toString()
有时ExecuteScale() 返回 NULL,则可以通过 catch (NullReferenceException) 编写相应
的代码。
SQL参数看看是不是正确
------解决方案--------------------------------------------------------
command.CommandText = SQL
SQL 是空值
本文档为【我真的不知道处理了】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。