Parameterized Store Procedures Failing


Author
Message
Jeff Pagley
Jeff Pagley
StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)StrataFrame User (465 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi SF Team,

I have just setup ES on a server and I began to do some testing.  The code (below) has been running for a couple of years on a local production server with a SQLExpress database, but when this same code (below) runs connecting through ES, I am getting an error (see below).  This piece of code is using a BO to run a parameterized stored procedure.  I am getting the same error when running other BOs using parameterized stored procredures.  It seems this error is associated with the BO.FillByStoredProcedure method.   What is going on?

Thanks,

Jeff

Public Sub FillByCallBackTop1ByCampaignIDAndUserIDAndDateRange(ByVal campaignID As Integer, ByVal userID As Integer, _

ByVal startDate As Date, ByVal endDate As Date, ByVal campaignMaximumCallTries As Integer)

Dim parms(4) As SqlParameter

parms(0) = New SqlParameter("@CampaignID", SqlDbType.Int)

parms(0).Value = campaignID

parms(1) = New SqlParameter("@UserID", SqlDbType.Int)

parms(1).Value = userID

parms(2) = New SqlParameter("@StartDate", SqlDbType.SmallDateTime)

parms(2).Value = startDate

parms(3) = New SqlParameter("@EndDate", SqlDbType.SmallDateTime)

parms(3).Value = endDate

parms(4) = New SqlParameter("@CampaignMaximumCallTries", SqlDbType.SmallInt)

parms(4).Value = campaignMaximumCallTries

Me.FillByStoredProcedure("CampaignContactsView_CallBack_Top_ByCampaignIDUserIDStartEndDate_Select", parms)

End Sub

=========================================================================================

Exception (EnterpriseDataSourceException)

Message = "An error occurred while executing the command on the remote data source. See the inner exception for more details."

InnerException (SqlException): Source=".Net SqlClient Data Provider"; Target=null; Tag=null; Class=16; LineNumber=0; Number=201; Server="TESTSERVER\SQLEXPRESS"; State=4; ErrorCode=-2146232060;

Message = "Procedure or Function 'CampaignContactsView_CallBack_Top1_ByCampaignIDUserIDStartEndDate_Select' expects parameter '@CampaignID', which was not supplied."

StackTrace =

" at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

at System.Data.SqlClient.SqlDataReader.get_MetaData()

at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior ... (truncated) ...xecuteReader(CommandBehavior behavior, String method)

at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

at MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack)

at MicroFour.StrataFrame.Data.SqlDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack)

at MicroFour.StrataFrame.Data.Enterprise.RequestProcessor.ExecuteDataTable(ExecuteDataTableParams params)"

Errors (SqlErrorCollection): Count=1;

#0 = {System.Data.SqlClient.SqlError: Procedure or Function 'CampaignContactsView_CallBack_Top1_ByCampaignIDUserIDStartEndDate_Select' expects parameter '@CampaignID', which was not supplied.}

Procedure = "CampaignContactsView_CallBack_Top1_ByCampaignIDUserIDStartEndDate_Select"

Environment: ThreadIdentity="" DateTime=["2010-01-29 07:53:48.537"] ThreadName=null WindowsIdentity="STRUSS\JPagley" ThreadId="10" DomainName="ProspectHelper.vshost.exe" OSVersion=["Microsoft Windows NT 5.1.2600 Service Pack 3"]

MachineName="1LPJPAGLEY" UserName="JPagley"


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search