Re: Help - Procedure expects parameter - It's There!!!



KalPesh,

I've done the best I know to follow your suggestion, but I am still
getting the same error.

Here is the code within DataAccess.vb
\\
Public PropertyValue As String

Public Property FKJobID() As String
Get
Return PropertyValue
End Get
Set(ByVal Value As String)
PropertyValue = Value
End Set
End Property
//

Here is code within the form...

\\
Private DAL As New CLIP.DataAccess
//

and ...

This code is executed by a button on the form so I can see that I can
see that it is doing what I expect. And yes the messagebox returns the
appropriate GUID string.
\\
Private Sub btnVerifyVariable_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnVerifyVariable.Click
Me.lblfkJob.Text = _fkJob
DAL.FKJobID = Me.cboSelectJob.SelectedValue.ToString
MessageBox.Show("Get property from DataAccess.vb: " & DAL.FKJobID)
End Sub
//

Again, here is the sql command from DataAccess.vb that is trying to get
the value from the property...
\\
With cmd050Oper_sel
.CommandType = CommandType.StoredProcedure
.CommandText = "usp_050Oper_sel"
.Connection = sqlConn
With cmd050Oper_sel.Parameters
.Add(New SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4,
ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte),
"", DataRowVersion.Current, Nothing))

'Filter... WHERE (sqfkJob = @sqfkJob)
.Add("@fkJob", SqlDbType.Text).Value = FkJobID
End With
End With
//

Am I wiring it up properly? I'm new to using properties.

Again here is the error and stacktrace;

---------------------------
Exception Message:
Procedure 'usp_050Oper_sel' expects parameter '@fkJob', which was not
supplied.
---------------------------

and ...

---------------------------
Exception StackTrace:
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior)
at
System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data,
Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
at CLIP.f050SqOO.btnLoad_Click(Object sender, EventArgs e) in
C:\Documents and Settings\dbuchanan\My
Documents\CLIP\Clip03_2005-09-23_diagnostic\Clip02\f050SqOO.vb:line 169
---------------------------

Thank you,
dbuchanan

.


Loading