PC Review


Reply
Thread Tools Rate Thread

Accessing Custom ADO Datasets

 
 
=?Utf-8?B?Um9i?=
Guest
Posts: n/a
 
      17th Mar 2005
I've created a representation of a relational structure using the XML schema
template. I've populated the structure using a series of 'flat' text files
(I'm doing this in anticipcation of also accessing an Oracle structure at a
later date). I've defined 'keys' on the relational structure. How do I access
data rows based on key values - for example I might have a key defined as
'first name', 'surname' - the only way I seem to be able to access the data
is to set up a FOR loop and compare the 2 data columns. Is there a way to set
up a 'query' which returns the row in a single statement?

thanks
 
Reply With Quote
 
 
 
 
VJ
Guest
Posts: n/a
 
      17th Mar 2005
Dim strSelect As String = "Col1 = '" & strvar1 & "' and Col2 = " &
intvar2
Dim dtRow() as DataRow = myDataSet.Tables(0).Select(strSelect)

you could use.. dtRow array and store it in DataSet, and manuiplate.. or
get the refrence row from dtRow array and directly update your primary
datasource...

"Rob" <(E-Mail Removed)> wrote in message
news:02019B5F-3729-468F-9583-(E-Mail Removed)...
> I've created a representation of a relational structure using the XML
> schema
> template. I've populated the structure using a series of 'flat' text files
> (I'm doing this in anticipcation of also accessing an Oracle structure at
> a
> later date). I've defined 'keys' on the relational structure. How do I
> access
> data rows based on key values - for example I might have a key defined as
> 'first name', 'surname' - the only way I seem to be able to access the
> data
> is to set up a FOR loop and compare the 2 data columns. Is there a way to
> set
> up a 'query' which returns the row in a single statement?
>
> thanks



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Mar 2005
Rob,

Beside the method VJ mentioned can you use to get a reference to that row

dataview.rowfilter = and than by instance use the same filter as VJ shows
you
datarowcollection.find which returns the datarow accoording to the primary
keys
dataview.find wich returns the postition in the dataview accoording to keys.

I hope this helps,

Cor


 
Reply With Quote
 
=?Utf-8?B?Um9i?=
Guest
Posts: n/a
 
      17th Mar 2005
Thanks VJ, Cor. I will try these methods out. The performance of the 'query'
will be interesting - at the moment I am using hashtables within hashtables
to simulate 1-to-Many relationships but this all starts to get hard when
going beyond this level of relationship or when you move into having complex
compound keys. Do you know if the definition of 'keys' on datatables actually
aid performance or are they there to maintain relational contraints?

"Cor Ligthert" wrote:

> Rob,
>
> Beside the method VJ mentioned can you use to get a reference to that row
>
> dataview.rowfilter = and than by instance use the same filter as VJ shows
> you
> datarowcollection.find which returns the datarow accoording to the primary
> keys
> dataview.find wich returns the postition in the dataview accoording to keys.
>
> I hope this helps,
>
> Cor
>
>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Mar 2005
Rob,

When it is about relations than I would seriously look to relations.

http://msdn.microsoft.com/library/de...tionstopic.asp

Using parent and childcollection you can get very fast than your
information.

I hope this helps

Cor


 
Reply With Quote
 
Jay Pondy
Guest
Posts: n/a
 
      17th Mar 2005
Keys most definitely improve performance.

On Thu, 17 Mar 2005 03:59:02 -0800, Rob
<(E-Mail Removed)> wrote:

>Thanks VJ, Cor. I will try these methods out. The performance of the 'query'
>will be interesting - at the moment I am using hashtables within hashtables
>to simulate 1-to-Many relationships but this all starts to get hard when
>going beyond this level of relationship or when you move into having complex
>compound keys. Do you know if the definition of 'keys' on datatables actually
>aid performance or are they there to maintain relational contraints?
>
>"Cor Ligthert" wrote:
>
>> Rob,
>>
>> Beside the method VJ mentioned can you use to get a reference to that row
>>
>> dataview.rowfilter = and than by instance use the same filter as VJ shows
>> you
>> datarowcollection.find which returns the datarow accoording to the primary
>> keys
>> dataview.find wich returns the postition in the dataview accoording to keys.
>>
>> I hope this helps,
>>
>> Cor
>>
>>
>>


 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th Mar 2005
Rob,

Now I see the message from Jay, I see that I got your message completly
wrong in my mind, therefore a correction. (Although probably that previous
is as well useful for what you are doing).

Keys make it you possible to select easy one DataRow from a DataTable. I am
not sure if there is real a performance benefit. That will depends as well
how you create them and how you use them. (When you create them one time
and use those 1000 times, it will be obvious that it is faster, in the
oposite way I am not sure).

I have seen that sometimes the datatable.select is much faster than the
dataview.rowfilter. However when the dataview is sorted and the rowfilter is
about that key, than the rowfilter is again faster.

Therefore I cannot give a real answer what is always faster.

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing another custom form and the associated custom property melon Microsoft Outlook Form Programming 1 1st Dec 2008 02:41 PM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? Francisco Garcia Microsoft ASP .NET 2 13th Apr 2006 11:41 AM
Accessing/Setting Custom Properties in a Custom TreeNode Bishop Microsoft VB .NET 0 29th Sep 2005 03:12 AM
DataSets V Custom Objects Moe Microsoft ADO .NET 7 15th Oct 2004 10:53 AM
Re: Can custom Objects hod datasets? Cor Ligthert Microsoft Dot NET 0 27th Aug 2004 10:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 PM.