Bill Humphrey
Active member
- Joined
- Apr 10, 2008
- Messages
- 35
- Programming Experience
- Beginner
Hi
I'm a bit of a rooky at vb .net and am trying to build up a where caluse to pass two date parameters 'StartDate' and 'EndDate' . I have priority working but I'm not sure of how to add the two dates in the where clause:
Any suggestions appreciated
Public Function GetCategoryPerformance(ByVal PriorityType As String) As DataSet
Dim cn As New SqlConnection("data source=CADTRAINING;persist security info=True;initial catalog=pathwaysreporting;user id=cad;password=cad;")
Dim da As SqlDataAdapter = New SqlDataAdapter("SELECT * from sp_category_performance where where priority = '" & PriorityType & "'", cn)
Dim ds As DataSet = New DataSet
Try
da.Fill(ds, "CategoryPerformance")
Catch ex As Exception
Throw New Exception(ex.Message)
End Try
Return ds
End Function
End Class
I'm a bit of a rooky at vb .net and am trying to build up a where caluse to pass two date parameters 'StartDate' and 'EndDate' . I have priority working but I'm not sure of how to add the two dates in the where clause:
Any suggestions appreciated
Public Function GetCategoryPerformance(ByVal PriorityType As String) As DataSet
Dim cn As New SqlConnection("data source=CADTRAINING;persist security info=True;initial catalog=pathwaysreporting;user id=cad;password=cad;")
Dim da As SqlDataAdapter = New SqlDataAdapter("SELECT * from sp_category_performance where where priority = '" & PriorityType & "'", cn)
Dim ds As DataSet = New DataSet
Try
da.Fill(ds, "CategoryPerformance")
Catch ex As Exception
Throw New Exception(ex.Message)
End Try
Return ds
End Function
End Class