问题描述
嗨!
我需要帮助对NullException错误进行排序.代码如下.请告诉我有什么问题.错误提示:该函数未在所有代码路径上返回任何值.
*************存储过程-GetAccountByCat ************
使用[ERPFinAccounting]
GO
/******对象:StoredProcedure [dbo].[GetAccountByCat]脚本日期:01/16/2011 10:45:02 ******/
设置ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
更改过程[dbo].[GetAccountByCat]
@AccCat varchar(1)
AS
选择*从AccountsTable中,其中AccountCat = @AccCat
**************************来自类*********
Hi!
I need help to sort NullException Error. The code is as given below. Pls. tell me what can be wrong. The error says: the function doesn''t return any value on all code paths.
************* Stored procedure - GetAccountByCat************
USE [ERPFinAccounting]
GO
/****** Object: StoredProcedure [dbo].[GetAccountByCat] Script Date: 01/16/2011 10:45:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetAccountByCat]
@AccCat varchar(1)
AS
SELECT * FROM AccountsTable WHERE AccountCat = @AccCat
*********************** from class *********
#Region "GetAccountDetail - Return Information about all Accounts"
Public Function GetAccountDetail(ByVal cat As String) As DataSet
Dim localDSOutput As DataSet
Dim ParamsStoredProcedure As String = "GetAccountByCat"
Try
Dim localOutPutServer As New DataServer(PrivateConnectionString)
localOutPutServer.BuildParameter( _
"@AccCat", cat, DataServer.SQLDataType.SQLChar, , ParameterDirection.Input)
localDSOutput = localOutPutServer.returnDataSet(ParamsStoredProcedure)
Return localDSOutput
Catch ExceptionObject As Exception
'LogException(ExceptionObject)
Finally
End Try
End Function
**************************
**************************
推荐答案
这篇关于NullException错误,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!