G
goldbond_8
I would like to use ADO.Net to connect to a Stored Procedure in SQL
Server and return a count of parameters from it. I was able to do this
using ADO and VB 6 using the following code:
' m_objConn is a database connection
Set m_objCmd2.ActiveConnection = m_objConn
m_objCmd2.CommandText = "TestSP"
m_objCmd2.CommandType = adCmdStoredProc
'Assign to var
m_iSPCount = m_objCmd2.Parameters.Count
When I try it with VB.Net, my count is always 0
m_objConn.Open()
Dim objCMD As SqlCommand = New SqlCommand()
objCMD.Connection = m_objConn
objCMD.CommandText = "TestSP"
objCMD.CommandType = CommandType.StoredProcedure
'Assign to var
Dim icount As Integer = objCMD.Parameters.Count
Does anyone know how to retrieve a count of parameters from a Stored
Procedure?
Server and return a count of parameters from it. I was able to do this
using ADO and VB 6 using the following code:
' m_objConn is a database connection
Set m_objCmd2.ActiveConnection = m_objConn
m_objCmd2.CommandText = "TestSP"
m_objCmd2.CommandType = adCmdStoredProc
'Assign to var
m_iSPCount = m_objCmd2.Parameters.Count
When I try it with VB.Net, my count is always 0
m_objConn.Open()
Dim objCMD As SqlCommand = New SqlCommand()
objCMD.Connection = m_objConn
objCMD.CommandText = "TestSP"
objCMD.CommandType = CommandType.StoredProcedure
'Assign to var
Dim icount As Integer = objCMD.Parameters.Count
Does anyone know how to retrieve a count of parameters from a Stored
Procedure?