|
-
Dec 3rd, 2004, 05:17 PM
#1
Thread Starter
Lively Member
Modifying rows [still problems :-( ]
Hi folks! Going crazy here. I got a dataset filled and now I need to modify a row of one of its tables. I know I can do it like this:
Dataset.Table1.Rows(x).("Name")="John"
Being x the row index. Now, I DON'T KNOW THE ROW INDEX of the row I want to modify, I know which row I want to change but HOW DO I FIND OUT ITS ROW INDEX SO THAT I CAN RUN THE COMMAND ABOVE?
Thanks for your help!
Last edited by nacho2; Dec 3rd, 2004 at 06:24 PM.
-
Dec 3rd, 2004, 05:27 PM
#2
Sleep mode
Re: Modifying rows
Use SQL UPDATE statement , using WHERE clause you can find the row by it's value .I'm sorry I can't give you an example now but try to search to save you some time.
-
Dec 3rd, 2004, 05:33 PM
#3
Thread Starter
Lively Member
Re: Modifying rows
Nope! Won't help!
I'm not storing my data in a SQL DB. I'm storing my data in an xml document. But still that shouldn't make a diference, because what I'm trying to do now is to modify the dataset and once I've done that I'll update the DB (in my case an xml document). But even if I was working with an SQL DB I wouldn't know how to modify the row in the dataset.
What I am implementing is a button_click that makes the field 'erased' of a row of a table to go from false to true.
Thanks
-
Dec 3rd, 2004, 07:19 PM
#4
Thread Starter
Lively Member
Re: Modifying rows [still problems :-( ]
There is a bunch of command for selecting, updating and deleting rows of a dataset all of them used the row index... (like the command above) SO THERE HAS TO BE A WAY OF GETTING THE ROW INDEX, something like Dataset.Table.Rows.GetRowIndex("IdCustomer=2")...
Any ideas? I appreciatte.
-
Apr 15th, 2006, 07:38 PM
#5
New Member
Re: Modifying rows [still problems :-( ]
icurrentpos=me.bindingcontext(dataset,"table").position '+1 if you need an offset
-
Apr 15th, 2006, 08:03 PM
#6
Re: Modifying rows [still problems :-( ]
So you're saying you know the primary key of the row? If so:
VB Code:
Dataset.Table1.Rows.Find(pkValue)("Name")="John"
-
Apr 16th, 2006, 02:57 AM
#7
Frenzied Member
Re: Modifying rows [still problems :-( ]
icurrentpos=me.bindingcontext(dataset,"table").position '+1 if you need an offset
and how does this relates to us
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|