Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. implementation of storedprocedures

implementation of storedprocedures

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chinnivinay
    wrote on last edited by
    #1

    how to implement stored procedures with outputparameters in asp.net

    C R 2 Replies Last reply
    0
    • C chinnivinay

      how to implement stored procedures with outputparameters in asp.net

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • C chinnivinay

        how to implement stored procedures with outputparameters in asp.net

        R Offline
        R Offline
        Ritika S
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups