|
-
Oct 4th, 2007, 09:14 PM
#1
Thread Starter
Lively Member
datatable select not found [2005]
hi all.i would like to know, why datatable.select(condition), sometimes it found records, but sometimes not found a record.
here this is an example of my datatable:
ID itemID
1 2
1 3
1 1
1 4
1 2 I don't want this record
2 3
2 4
2 1
2 3 I don't want this record too.
I would like to insert without a duplicate value.
and here is my datatable.select function(purpose of the function is to search)
Code:
Private Function SearchDataTable(ByVal dt As DataTable, ByVal condition As String) As Integer
Dim ReturnValue As Integer
ReturnValue = dt.Select(condition).Length
Return ReturnValue
End Function
Private sub cmd_Click()
if searchdatatable(dt, "id=" & id & " and ItemID=" & txtItemID.text)=0 then
........
........
........
End If
........
........
........
End Sub
anyidea please, many thank for your help.
-
Oct 5th, 2007, 03:11 PM
#2
Fanatic Member
Re: datatable select not found [2005]
When you do your SELECT, put SELECT Distinct
If your problem is solved, please use the Mark Thread As Resolved under Thread Tools!
Show Appreciation. Rate Posts!
-
Oct 8th, 2007, 07:58 PM
#3
Thread Starter
Lively Member
Re: datatable select not found [2005]
I would like to insert records without dublicate value. The items from above, It is a result from my insert, because my search function not work well. so more please?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|