Stored Procedure not working with Application Data Block RRS feed

  • Question

  • User-508499303 posted
    Not sure what Im doing wrong, but Im learning how to creat a n tier application. Im separating my presentation from my data and data access. In the data access layer I have the following code: Imports System.Data.SqlClient Imports Microsoft.ApplicationBlocks.Data.SqlHelper Public Class UsersDB Public Shared Function GetUserDetails(ByVal ConnectionString As String, ByVal UserId As Integer) As UserDetails Dim arParms() As SqlParameter = New SqlParameter(3) {} ' @ProductID Input Parameter ' assign a "1" for ProductID parameter value arParms(0) = New SqlParameter("@UserId", SqlDbType.Int) arParms(0).Value = 47 ' @ProductName Output Parameter arParms(1) = New SqlParameter("@UserName", SqlDbType.VarChar, 40) arParms(1).Direction = ParameterDirection.Output ' @UnitPrice Output Parameter arParms(2) = New SqlParameter("@Email", SqlDbType.VarChar) arParms(2).Direction = ParameterDirection.Output ' @QtyPerUnit Output Parameter arParms(3) = New SqlParameter("@Password", SqlDbType.VarChar, 20) arParms(3).Direction = ParameterDirection.Output Try ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, "spUsersGetById", arParms) ' Create CustomerDetails Struct Dim myUserDetails As UserDetails = New UserDetails() ' Populate Struct using Output Params from SPROC myUserDetails.UserName = CStr(arParms(1).Value) myUserDetails.Email = CStr(arParms(2).Value) myUserDetails.Password = CStr(arParms(3).Value) Return myUserDetails Catch End Try End Function End Class However, when I run this, I get a stack overflow error. Any ideas what Im doing wrong?
    Wednesday, February 11, 2004 5:02 PM

All replies

  • User-1907454718 posted
    Where is this bombing out? Also, you could put (not sure of exact vb syntax) Catch (e as Exception) then either put the value of e.message to a lable or write it out in debug to see what that's telling you. Does your overflow message tell you what line your bombing out on?
    Thursday, February 12, 2004 9:39 AM