I am doing that.But if I upload my items again they are duplicated
even though i am passing the same id. They should just be updated. And
if i get my data it is still using the default atomid like
http://www.google.com/base/feeds/items/16250520191364245477
On Oct 6, 2:26 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote:
> You can set it like any other custom attribute:
>
> GBaseEntry entry = new GBaseEntry();
> entry.GBaseAttributes.AddTextAttribute("id", "1234ads65zxcv4");
> ...
>
> Checkout the .NET developer's
> guide:http://code.google.com/apis/base/csharpdevguide.html
>
> Eric
>
> On Oct 6, 8:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > Yea but how do i set <g:id> from my code is there an example in c# or
> > vb.net. I cannot just type <g:id>
>
> > On Oct 3, 8:16 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote:
>
> > > You need to use the server's assign id for the item,
> > > otherwise it'll just be inserted again. You can verify
> > > this with the API demo page (http://www.google.com/base/api/demo/html/
> > > demo.html).
> > > If I try to insert an item with a user-defined atom:id
> > > it gets overwritten by whatever the server assigns.
>
> > > In C# the update code would be:
> > > GBaseEntry entry = service.GetEntry(myEntryId);
> > > // change some attributes
> > > service.Update(entry);
>
> > > where myEntryId is the server's <id>.
>
> > > If you want to import your own id's from the database,
> > > I would set a custom attribute:
>
> > > <g:id>your id</g:id>
>
> > > Eric
>
> > > On Oct 3, 11:45 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > I am using the ..net class library so my line of code is
> > > > insert.Id = New AtomId(dr("id")) where dr("id") is from my database
>
> > > > On Oct 2, 6:52 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote:
>
> > > > > Are you using an HTTP PUT to update the item?
> > > > > Note: POST will insert it.
>
> > > > > ex:
> > > > > PUT /feeds/items/123456789
>
> > > > > where 123456789 is the <atom:id> that Celebird mentioned.
> > > > > You should use the ID returned by the server.
>
> > > > > Eric
>
> > > > > On Oct 2, 3:41 pm, Celebird <[EMAIL PROTECTED]> wrote:
>
> > > > > > i believe g:id is a surrogate for inserts and updates
> > > > > > and required for some item-types; whereas atom:id is
> > > > > > required for deletes and is under google-base control.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Base Data API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Base-data-API?hl=en
-~----------~----~----~----~------~----~------~--~---