no Index?
hmm.
Ok
Thanks again Bonnie.
>
>How do I create an index on my DataView to do a SEEK() on it?>
>There are no indexes in .NET.
>
>You're on the right track Sam, but try using the DataView.Find() method. The DataView needs to be sorted on the column you're searching for. So, try this instead:
>
>
>DataView myDataView = new DataView(SrcDataSet.Tables[0]);
>myDataView.Sort = "cust_id";
>int RecNo = myDataView.Find("10001");
>
>
>This gives you the row number in the DataView, so you can access the data either like this:
>
>DataRowView row = myDataView[RecNo];
>
>-or-
>
>DataRow row = myDataView[RecNo].Row;
>
>
>~~Bonnie
>
>
>
>
>>Hi Einar.
>>I've been trying to find how to SEEK my DataView, but I could'nt find a way. So I did this.
>>
>>
>> SrcDataAdapter.Fill(SrcDataSet,"customer");
>>
>> DataView myDataView = new DataView(SrcDataSet.Tables[0]);
>>
>> myDataView.RowFilter = "cust_id = '10001'";
>>
>> int ncnt = myDataView.Count;
>>
>>
>>
>>I know it's probably not the best thing, but it works.
>>
>>How do I create an index on my DataView to do a SEEK() on it?
>>
>>TIA.
>>
>>
>>>>Is there an simple elegant way to do the following in C#?
>>>>
>>>>
>>>>i=1
>>>>DO WHILE SEEK(i, 'testTbl', 'testInx')
>>>> i = i + 1
>>>>ENDDO
>>>>
>>>>RETURN i
>>>>
>>>>
>>>>TIA
>>>
>>>
>>>private int fubar()
>>>{
>>> int i = 1;
>>> while (SEEK(i, "testTbl", "testInx"))
>>> {
>>> i++;
>>> }
>>> return i;
>>>}
>>>
The American Republic will endure, until politicians realize they can bribe the people with their own money.
- Alexis de Tocqueville
No man’s life, liberty, or property is safe while the legislature is in session.
– Mark Twain (1866)