G
Guest
Hi Everyone,
I'm having a slight problem, I hope I didn't overlook something. I'm getting
the following error when I try to execute the function below:
Incorrect syntax near 'intake_GetListSet'."
Private sub LoadListSet()
dim da as New SqlDataAdapter
Dim cmd as New SqlCommand
try
cmd.Connection = OpenConnection()
cmd.CommandType = CommandType.Text
cmd.CommandText = "intake_GetListSet"
cmd.Parameters.Add("@PatientId",SqlDbType.VarChar , 20).Value = fPatientId
da.SelectCommand = cmd
ListSet.Clear
da.Fill(ListSet) >>>> Errors here.
Catch ex As Exception
msgbox(ex.Message )
finally
cmd.Connection.Dispose
da.Dispose
End Try
End Sub
The Stored proc follows.
CREATE PROCEDURE [dbo].[intake_GetListSet]
@PatientId varchar(20)
AS
SELECT List.KeyId, List.PatientId, List.ExamId, List.TypeId,
ListTypes.TypeName, List.ListType
FROM (PhysicalExamination LEFT JOIN Medeator
ON PhysicalExamination.KeyId = Medeator.ExamId)
LEFT JOIN (List LEFT JOIN ListTypes ON List.TypeId = ListTypes.TypeId) ON
Medeator.ForeignKeyId = List.KeyId
Where List.PatientId = @PatientId
GO
In SQL Enterprise Manager the stored proc works just fine. It only seens to
error in the code above. fPatientId does have a valid value. Does anyone have
an idea whats going on. Thanks for any help.
Michael
I'm having a slight problem, I hope I didn't overlook something. I'm getting
the following error when I try to execute the function below:
Incorrect syntax near 'intake_GetListSet'."
Private sub LoadListSet()
dim da as New SqlDataAdapter
Dim cmd as New SqlCommand
try
cmd.Connection = OpenConnection()
cmd.CommandType = CommandType.Text
cmd.CommandText = "intake_GetListSet"
cmd.Parameters.Add("@PatientId",SqlDbType.VarChar , 20).Value = fPatientId
da.SelectCommand = cmd
ListSet.Clear
da.Fill(ListSet) >>>> Errors here.
Catch ex As Exception
msgbox(ex.Message )
finally
cmd.Connection.Dispose
da.Dispose
End Try
End Sub
The Stored proc follows.
CREATE PROCEDURE [dbo].[intake_GetListSet]
@PatientId varchar(20)
AS
SELECT List.KeyId, List.PatientId, List.ExamId, List.TypeId,
ListTypes.TypeName, List.ListType
FROM (PhysicalExamination LEFT JOIN Medeator
ON PhysicalExamination.KeyId = Medeator.ExamId)
LEFT JOIN (List LEFT JOIN ListTypes ON List.TypeId = ListTypes.TypeId) ON
Medeator.ForeignKeyId = List.KeyId
Where List.PatientId = @PatientId
GO
In SQL Enterprise Manager the stored proc works just fine. It only seens to
error in the code above. fPatientId does have a valid value. Does anyone have
an idea whats going on. Thanks for any help.
Michael