1 message in com.googlegroups.google-base-data-apihelp with code for .NET 2.0 web appli...
FromSent OnAttachments
mike04 Sep 2006 21:57 
Subject:help with code for .NET 2.0 web application
From:mike (mike@gmail.com)
Date:09/04/2006 09:57:57 PM
List:com.googlegroups.google-base-data-api

Hi,

I've taken a look at the form1.vb example code and was able to get some help from it. What I am looking to do is pretty simple, just insert a item into GoogleBase every time my website ads a new item.

I'm really not sure where to go from here? I haven't found very much specific help for this.

You can see theres parts of the code I am not sure what values to fill with ..

Lines like this: Dim batchFeed As AtomFeed = New AtomFeed(Me.batchFeed)

as well as this part:

Dim returnFeed As GBaseFeed = service.Batch(batchFeed, New Uri(Me.batchFeed.Batch)) For Each entry As GBaseEntry In returnFeed.Entries If entry.BatchData.Status.Code > 300 Then lblMsg.Text = "errors encountered" Exit Sub End If Next

Can anyone offer any assistance? It would be very much appreciated.

Thanks again, Mike

Dim gbase_applicationName As String = "asdf" Dim gbase_applicationKey As String = "asdf" Dim gbase_userName As String = "asdf" Dim gbase_password As String = "asdf"

Dim service As GBaseService = New GBaseService(gbase_applicationName, gbase_applicationKey)

If (gbase_userName > 0) Then service.setUserCredentials(gbase_userName, gbase_password) End If

Dim batchFeed As AtomFeed = New AtomFeed(Me.batchFeed)

batchFeed.BatchData = New GDataBatchFeedData batchFeed.BatchData.Type = GDataBatchOperationType.insert

Dim entry As GBaseEntry = New GBaseEntry Dim author As AtomPerson = New AtomPerson

entry.Authors.Add(author)

entry.BatchData = New GDataBatchEntryData entry.BatchData.Id = i.ToString()

author.Name = "Author" entry.Title.Text = "Title" entry.Content.Content = "Content" entry.GBaseAttributes.ItemType = "ItemType"

entry.BatchData.Type = GDataBatchOperationType.insert

batchFeed.Entries.Add(entry)

' upload Dim returnFeed As GBaseFeed = service.Batch(batchFeed, New Uri(Me.batchFeed.Batch))

For Each entry As GBaseEntry In returnFeed.Entries

If entry.BatchData.Status.Code > 300 Then lblMsg.Text = "errors encountered"

Exit Sub End If Next