Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do While Seek()... Enddo
Message
From
13/01/2007 00:42:10
 
 
To
13/01/2007 00:28:24
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01184819
Message ID:
01185326
Views:
11
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform