Public Function Delete_GST_Entry(ByVal GE_ID As Integer) As DataTable
Try
Using con As New SqlConnection(DF_Class.GetConnectionString())
Dim ds As DataTable = New DataTable
con.Open()
Dim command As SqlCommand = New SqlCommand("Delete_GSTEntry", con)
command.Parameters.AddWithValue("GE_ID", GE_ID)
command.CommandType = CommandType.StoredProcedure
Dim adapter As SqlDataAdapter = New SqlDataAdapter(command)
Dim table As DataTable = New DataTable
adapter.Fill(ds)
Return ds
con.Close()
End Using
Catch ex As SqlException
MessageBox.Show(ex.Message, "Data Input Error")
End Try
End Function
我收到一个警告,说NULL reference could occur
. 我在做什么错误?
警告:
“函数 'Delete_GST_Entry' 不会在所有代码路径上返回值。在使用结果时,运行时可能会发生空引用异常。”