implementation of storedprocedures
-
how to implement stored procedures with outputparameters in asp.net
-
how to implement stored procedures with outputparameters in asp.net
The same way you do it outside ASP.NET. ASP.NET is irrelevant. You specify parameters as output parameters when you add them, and check their value on return.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
how to implement stored procedures with outputparameters in asp.net
Hi, u can use this as an example which returns integer as output value Public Function GetMailSent(ByVal CaseId As String) As Integer Dim objConn As New SqlConnection Dim objDB As New clsCommon Dim objDS As New DataSet Dim objCommand As New SqlCommand Dim objDA As New SqlDataAdapter Dim param As New SqlParameter Dim intMailSent As Integer Try objConn = objDB.GetDatabaseConnection objCommand.CommandType = CommandType.StoredProcedure objCommand.CommandText = "spGetMailSent" objCommand.Connection = objConn objDA.SelectCommand = objCommand objCommand.Parameters.Add("@CaseID", SqlDbType.VarChar).Value = IIf(IsDBNull(CaseId), DBNull.Value, CaseId) param = objCommand.Parameters.Add("@retval", SqlDbType.Int) param.Value = Decimal.Zero param.Direction = ParameterDirection.Output intMailSent = objCommand.ExecuteNonQuery() GetMailSent = objCommand.Parameters("@retval").Value Finally 'objDB.CloseDatabaseConnection() End Try End Function Regards,
Ritika