|
-
May 22nd, 2006, 05:15 AM
#1
Thread Starter
Addicted Member
Check returned records
I have a function that adds to my collection, but I dont want to add it to my collection if more than one result is returned, how can I check how many records are being returned in the dataset ??
VB Code:
If e.Column.Key = "productRangeCode" Then
If _rangeCode.Length > 0 Then
Dim _component As New Component
_component.Load(_rangeCode) ' This calls my load function in my class
'I need to check here how many are returned before adding to my collection ??????
product.Formulation.Add(_component)
GridExFormula.Refetch()
End If
Thanks
Last edited by soluga; May 22nd, 2006 at 06:54 AM.
-
May 22nd, 2006, 05:59 AM
#2
Re: Check returned records
I have no idea what any of that code is doing so because you haven't given any indication of what any of the objects or methods are. A bit of context might be nice. My guess would be that instead of testing that Length is greater than zero you should test that it's equal to one.
-
May 22nd, 2006, 06:42 AM
#3
Thread Starter
Addicted Member
Re: Check returned records
sorry, was bit vague wasnt it.
anyway I figuered it out...
VB Code:
_recordsCount = _component.Load(_rangeCode, _colourCode, _versionNumber).Tables(0).Rows.Count
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
|