Select query on datatable

lidds

Well-known member
Joined
Nov 9, 2004
Messages
210
Hi,

At the moment I am using the following code to populate a datatable using a stroed procedure, which return a large amount of information from my MS SQL table. What I would like to do is then apply an SQL select statement to the datatable so that I can filter down the data in the datatable further. The reason why I want to do this is instead of having a large number of stored procedures for each senario, is this possible

Code:
Dim myDA As New OleDb.OleDbDataAdapter("spQryParentComments", myDB.myConn)
            myDA.SelectCommand.CommandType = CommandType.StoredProcedure
            myDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter("@projName", OleDb.OleDbType.VarChar)).Value = RISData.Instance.ProjectName
            myDA.SelectCommand.Parameters.Add(New OleDb.OleDbParameter("@userID", OleDb.OleDbType.VarChar)).Value = RISData.Instance.UserID

            Dim dataParentTable As DataTable = New DataTable("Parent")

 e.g.
dataParentTable.selectcommand("SELECT * WHERE [column] = [XYZ]")

            myDA.Fill(dataParentTable)

Thanks in advance

Simon
 
Back
Top