A field or property with the name 'tId' was not found on the selected data source.

Hi there, I got this message describe on the title. There are 3 parameters on the SP, but I need to get the Id as well to be used on a gridview.

Partial Class Management_Patients_SearchPatient
    Inherits System.Web.UI.Page
    Dim Name, LastName, Gender As String
    Dim DOB As Date

    Protected Sub SearchButton_Click(sender As Object, e As System.EventArgs) Handles SearchButton.Click
        Name = PatientName.Text
        LastName = PatientLastName.Text
        Gender = ddlGender.SelectedValue
        DOB = CDate(PatientDOB.Text)
        BindPatients(Name, LastName, Gender, DOB)
        ClearText()
    End Sub

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then

            
            

        End If
    End Sub
    Sub BindPatients(Name As String, LastName As String, Gender As String, DOB As Date)
        Dim objEhrPatients As New TarmarikDataContext
        GVPatients.DataSource = objEhrPatients.Get_Patients(Name, LastName, Gender, DOB)
        GVPatients.DataBind()

    End Sub
    Sub ClearText()
        PatientName.Text = ""
        PatientLastName.Text = ""
        ddlGender.SelectedValue = -1
        PatientDOB.Text = ""

    End Sub

    Protected Sub GVPatients_RowCommand(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GVPatients.RowCommand

    End Sub
End Class

Open in new window


ALTER PROCEDURE [dbo].[Get_Patients] 
	
	@PatientName varchar(50),
	@PatientLastName varchar(50),
	@PatientGender varchar(1),
	@PatientDOB date
	
AS
BEGIN
	
	SET NOCOUNT ON;

	select	Id, PatientName AS [Name],PatientLastName as [Last Name],PatientGender as Gender ,PatientDOB as [Date of Birth]
	from	Patients
	where	
			
			PatientName			= @PatientName and
			PatientLastName		= @PatientLastName and
			PatientGender		= @PatientGender and 
			PatientDOB			= @PatientDOB 
	ORDER BY PatientID	
END

Open in new window

gfrancoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guru_samiCommented:
As the error says "tId" so you might have misspelled "Id" in your gridview.
Check or share your .aspx  code.
0
gfrancoAuthor Commented:
No is misspeling when I posted the questions. It is ID alias of PatientID
0
Johny BravoCommented:
Can you show this method,

>>objEhrPatients.Get_Patients(Name, LastName, Gender, DOB)

What it returns dataset/List<>?
0
dejaanbuCommented:
in aspx page, compare your columnnames [Aliases] with the Gridview's column markup
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.