Searching within a dataset

vishalsethia

New member
Joined
Jun 24, 2005
Messages
4
Programming Experience
Beginner
I have a dataset filled with a dataadapter. I create a datatable and clone it with the dataset, so that the selected records can be made the datasource to the datagrid.

Then i create a datarow collection and select a particular set of records using the select command of the dataset
Here is a my code snippet

Dim rows As DataRow()
Dim table As New DataTable
table = Ds.Tables(0).Clone

rows = Ds.Tables(0).Select("LAST_NAME = _
'" &
Me.txtSearchLastName.Text & "'")
For Each row As DataRow In rows
table.ImportRow(row)
Next
Me.DataGrid1.DataSource = table


All this works fine, but i need to select using the "%" symbol as done in oracle, (Similar to like command in Oracle -- Select * from table where lastname like 'abc%')

But when using dataset, it returns only those records whose name completely matches

any inputs on how that can be achieved


--Vishal
 
Hi,

" Like " command seems to be working in dataset, this i found out after posting this thread.

this is the code that i used

ds.Tables(0).Select("LAST_NAME like '" & Me.txtSearchLastName.Text & "%'")

Anyways, thanks for all ur suggestions
 
Back
Top