badubo Please help me

Help each other out

badubo Please help me

Postby lar282 on Thu May 04, 2006 6:57 am

Hi
One of the members of the french team helped me out with a C# class called XDba.cs

I got a small issue that when I try to add or remove an item in a datasbe the class somehow removes the PATH in a existing datasbe file
<paths>
<path>D:\recorded_tv</path>
</paths>

What I'm really trying to do is replace or add info of an existing item, but that does not seem to work so I remove it first and then add a new item

Can u guys help me out once again please


Regards
//Lasse
mailto:lasse10@telia.com
Last edited by lar282 on Wed May 10, 2006 7:53 am, edited 1 time in total.
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby lar282 on Thu May 04, 2006 10:36 am

Looking for Badubo , found the old post

badubo
engineer
writer




Joined: 03 May 2004
Posts: 376
Location: Belgium
Posted: Thu Nov 10, 2005 5:20 pm Post subject:

--------------------------------------------------------------------------------

I have one (but it is not documented)
http://france.xlobby.com/forum/badubo/XDba.cs
_________________
Badubo
Member of XLobby FR Team
~~~~~~~~~~~~~~~~~
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby lar282 on Wed May 10, 2006 7:53 am

badubo where art you
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby badubo on Wed May 10, 2006 8:35 am

Paths were not relevant for my needs (they are used for templates and as I create personalized dba, I don't need them) so I didn't integrate the load and save of this info.

But as you have the source code, you can easilly adapt the class for loading paths and saving them. No?
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby lar282 on Wed May 10, 2006 8:54 am

I can try.

Do u remember if u implemented CHANGE a existing item in a datasbe
Right now I delete all then add them again, cause I could figure out how to modify an existing item. When I tried it added a new one so I ended up with duplicates.


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby badubo on Wed May 10, 2006 9:13 am

changing an existing item is not adding a new item with "same info" (xlobby authorize duplicates in dba)

You have to extract (find) the item you want to change in the dba, and simply change it.
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby lar282 on Wed May 10, 2006 9:19 am

So I first
lst=DbaRec.Find("Parameter",strfile);

Then copy the array to someother place and then
item = (XDbaItem)lst[0];
DbaRec.RemoveItem(item);

and then add it again from the copied array?
DbaRec.AddItem(copy_of_lst);


I really appriciate your help.Please bare with me.....

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby badubo on Wed May 10, 2006 10:09 am

you do not have to remove it
you can simply use the item instance and modifying its content
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby lar282 on Wed May 10, 2006 11:35 am

thanks for the tip, but I must be dumb...

u said
you can simply use the item instance and modifying its content

but there is no DbaRec.Modify or saveitem...Only Save exist and then the file gets saved. I don't get how to modify the instance.Do u have 3 minutes of more patience with me?


lst=DbaRec.Find("Parameter","Alias");
item = (XDbaItem)lst[0];
item="now I moddify this";
//So how do I save it?
DbaRec.Save(); ????

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby badubo on Wed May 10, 2006 12:19 pm

did you test the code you wrote?

Once you have modified the item, you can save the file, it will dump the content of the dba instance (and as the item is in the internal list, it will be dumped also)
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby lar282 on Mon May 15, 2006 1:34 pm

Forgot to say.......

THANK YOU


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden