Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

if object A has six rows of data within it and I want to create six new objects each using one row from object A is there a way to do it?

 

If I use object1 = objectA I obviously get all rows returned in objectA.

 

If I move to each row within objectA then try the same line I get all rows.......obviously

 

I need to modify each row as a single entity.....

 

Might be being dump here but ADO and objects are fairly new to me as VB.Net so forgive what might be a stupid question :-(

My website
Posted

theres no such thing as stupid questions just stupid people :) (no i'm not calling you stupid lol)

 

My best guess would be that an assignment statement isn't what you are looking for here... maybe you should look at a loop to set the properties of an object individually...

I wish i would have finished my ADO book by now and i'd be able to help more... I think there is a method there that returns a single row but i don't know...

 

until you can find that holy graile.. i'd suggest using a round about technique until you do find the right solution.

 

although the guys here are pretty good someone is bound to know

i'm not lazy i'm just resting before i get tired.
Posted
Dim resultRows as DataRow() 'This is an array of rows


resultRows = myOriginalTable.Select(vbnullstring) ' you could have entered any SQL WHERE clause here

.nerd
Posted

Hi,

 

what I did was to create a new constructor which has two parameters passed to it from objectA which allows for the identification of each row, this creates six new objects using each seperate row within objectA.

 

Not sure if this is the most efficient way to go about it......but it works!

My website

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...