hog Posted March 22, 2003 Posted March 22, 2003 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 :-( Quote My website
bpayne111 Posted March 23, 2003 Posted March 23, 2003 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 Quote i'm not lazy i'm just resting before i get tired.
Heiko Posted March 23, 2003 Posted March 23, 2003 Dim resultRows as DataRow() 'This is an array of rows resultRows = myOriginalTable.Select(vbnullstring) ' you could have entered any SQL WHERE clause here Quote .nerd
hog Posted March 24, 2003 Author Posted March 24, 2003 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! Quote My website
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.