I have a problem with my search im trying to search using 2 parameters but it giving meAN ERROR says : Procedure or function 'Learner_Existance' expects parameter'@AccessionNo', which was not supplied.
Here is my Store Proc...
create procedure [dbo].[Learner_Existance]
@EmisCode varchar(9),
@AccessionNo nvarchar(250)
AS
Select EmisCode,
AccessionNo,
Fname,
Sname,
Initials,
Gender,
Title ,
BirthDate ,
Religion,
Address1 ,
Address3 ,
AddressCode,
HomeLanguage ,
InstructionLanguage ,
PreferredLanguage ,
Race,
Citizenship,
PreviousSchoolProvince,
PreviousPlacementofSchool ,
PreviousSchool,
ProvinceResidence,
PhysProvince ,
Transport,
DeceasedParent,
LuritsNumber from Learner_Info
where EmisCode=@EmisCode
and AccessionNo = @AccessionNo
..................................................................................
Here My Business Layer
Public Function Get_Learner(ByVal Code As String, ByVal Num As String) As List(Of Learner)
Dim objDal As New csSQLDALVB
Dim objParList As New List(Of csParameterListType)
Dim objList As New List(Of Learner)
Dim dr As IDataReader
objParList.Add(New csParameterListType("@EmisCode", SqlDbType.VarChar, Code))
objParList.Add(New csParameterListType("@AccessionNo", SqlDbType.NVarChar, Num))
dr = objDal.executespreturndr("Learner_Existance", objParList)
Using dr
While dr.Read
Dim ll As New Learner
populate_reader(dr, ll)
objList.Add(ll)
End While
End Using
Return objList
End Function
..................................................................................
And My Client Side
Protected Sub btnsearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnsearch.Click
Dim objL As New Learner
Dim objlist As New List(Of Learner)
Dim code As String
Dim accesion As String
Try
objlist = objL.Get_Learner(txtEmiscode.Text, txtAccession.Text)
For Each ll As Learner In objlist
If objlist.Count <> 0 Then
code = ll.EmisCode
accesion = ll.AccessionNo
Response.Redirect("~/Emis_LearnerView.aspx" & "?EmisCode=" & code & "?AccessionNo=" & accesion)
Else
lblerror.Text = "cannot find student"
End If
Next
Catch ex As Exception
lblerror.Text = ex.Message
End Try
End Sub
End Class
please help me guys it almost a week now