Thanks!
I'm just following the sample from here:
http://code.google.com/apis/base/docs/2.0/developers_guide_dotnet.html#inserting
And I'm using the following code:
private void PostData_Click(object sender, EventArgs e)
{
GBaseService service = new GBaseService("Google-
Tutorial-1.0", this.AppKey.Text.Trim());
GDataGAuthRequestFactory f = (GDataGAuthRequestFactory)
service.RequestFactory;
f.AccountType = "HOSTED_OR_GOOGLE";
service.setUserCredentials(this.Username.Text.Trim(),
this.Password.Text.Trim());
GBaseEntry entry = new GBaseEntry();
entry.Title.Text = "My House";
entry.Content.Content = "The best house of the area.";
entry.GBaseAttributes.ItemType = "test";
entry.GBaseAttributes.AddTextAttribute("my attribute",
"hello");
entry.GBaseAttributes.AddFloatAttribute("bathrooms", 2f);
entry.GBaseAttributes.AddFloatAttribute("rooms", 6.5f);
entry.GBaseAttributes.AddFloatAttribute("bedrooms", 2f);
entry.GBaseAttributes.Location = "1900 Snow Cone Avenue,
North Pole";
GBaseEntry myEntry = service.Insert(new Uri
(this.BaseUri.Text.Trim()), entry);
}
this.BaseUri.Text="https://www.google.com/base/feeds/items". However,
I'm getting null after calling the Insert method.
if I use GBaseEntry myEntry = service.Insert
(GBaseUriFactory.Default.ItemsFeedUri, entry); I'll get the Service
Not Found (404) error.
Can you please help look into it, thanks a lot!!
On Jul 2, 10:28 pm, Frank Mantek <[email protected]> wrote:
> There are a few unittests, written in C# here:
>
> clients/cs/src/unittests/gbase.cs
>
> And yes, i was refering to the gbase_demo project..
>
> Frank
> On Jul 2, 2009, at 3:59 PM, marco wrote:
>
>
>
> > Do you mean the gbase_demo project which comes in VB.NET?
>
> > And what's the unittests for googlebase? I did not find it here.
>
> > On Jul 2, 8:44 pm, Frank Mantek <[email protected]> wrote:
> >> Did you look at the sample code? and the unittests for googlebase?
> >> they both do what you want...
>
> >> Frank
> >> On Jul 2, 2009, at 1:42 PM, marco wrote:
>
> >>> I can now connect to Google Base via API using .NET. However, I
> >>> cannot
> >>> retrieve any items from my Google Base account and every time, it’s
> >>> return 0 item when I query. And it just returns null when I try to
> >>> insert any item into the Google Base.
>
> >>> Furthermore, when I try to manual create an item in my Google Base
> >>> control panel using one of our company’s product, it got disapproved
> >>> as well.
>
> >>> I’m using C#.net to code the application. If anyone can help,
> >>> thanks a
> >>> lot! Or if anyone could provide simple example in .NET which can
> >>> insert item to Google Base via API, that's the best!
>
> >>> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---