VB.NET function for Stored Procedures..........................

Unknown | 6:41 AM |

Public Shared Function proc(ByVal prcname As String, ByVal prcnames() As String, ByVal prcvalues() As String) As String
        Dim id As String = ""
        Dim cmd As New SqlCommand
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = prcname

        Dim i As Integer = 0
        For i = 0 To prcnames.Length - 1
            cmd.Parameters.AddWithValue(prcnames(i).ToString(), prcvalues(i).ToString())
            cmd.Parameters(prcnames(0)).Direction = ParameterDirection.InputOutput
        Next
        DataConnect.GetInstance.ExecuteNonQuery(cmd)
        id = cmd.Parameters(prcnames(0)).Value
        Return id
    End Function

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....