我真的不知道怎么办了
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 中。
其他信息: 未将对象引用设置到对象的实例。