Re: Function doesn't return a value on all code paths
- From: "Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx>
- Date: Wed, 2 Aug 2006 19:58:41 +0200
"a" <aa@xxxxxx> schrieb:
The error is Function BindData doesn't return a value on all code paths
But I only see one code path. What am I missing?
Private Function BindData(ByVal count As Integer, ByVal custID As Integer, ByVal tempID As Integer, ByVal groupID As Integer)
cmd = New SqlCommand("stp_getPreparedMessages", con)
da.SelectCommand = cmd
da.SelectCommand.CommandType = CommandType.StoredProcedure
da.SelectCommand.parameters.addwithvalue("@int_rCount", pSize)
da.SelectCommand.parameters.addwithvalue("@int_UserGroupId", groupID)
da.SelectCommand.parameters.addwithvalue("@int_CustomerID", custID)
da.SelectCommand.parameters.addwithvalue("@int_UserIdAdd", Session("userID"))
da.SelectCommand.parameters.addwithvalue("@sint_AccessLevel", Session("accessLevel"))
da.SelectCommand.parameters.addwithvalue("@int_tempid", tempID)
da.SelectCommand.parameters.addwithvalue("@int_pageCount", SqlDbType.Int).Direction = ParameterDirection.Output
da.Fill(ds, "tblPrepMsgs")
pCount = da.SelectCommand.Parameters("@int_pageCount").Value
dgPreparedMsgs.DataSource = ds.Tables("tblPrepMsgs")
dgPreparedMsgs.DataBind()
End Function
The function neither contains a 'Return <value>' statement nor does it contain an assignment to the function name. Thus you may want to replace the 'Function' with 'Sub'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
.
- References:
- Prev by Date: Re: Unique an array of strings
- Next by Date: Re: Directly Passing Variables
- Previous by thread: RE: Function doesn't return a value on all code paths
- Next by thread: Re: Function doesn't return a value on all code paths
- Index(es):
Relevant Pages
|