views:

178

answers:

1

Hi,

I've seen; http://stackoverflow.com/questions/725627/accessing-google-spreadsheets-with-c-using-google-data-api

and

http://code.google.com/apis/spreadsheets/data/2.0/developers_guide_dotnet.html#CreatingRows

However i'm still having trouble inserting a new row in to an existing google spread sheet. Does anyone have a canned example which inserts a List<string> for example in to new row in a spreadsheet workbook.

Many thanks,

+1  A: 

Use GDataDB http://code.google.com/p/mausch/source/browse/trunk/GDataDB

GDataDB provides a simple way to insert .net POCO entities in to a google spread sheet.

    public void AddToGoogle()
    {
        var client = new DatabaseClient(Settings.Default.GmailAccount, Settings.Default.GmailPassword);
        string dbName = Settings.Default.WorkBook;

        var db = client.GetDatabase(dbName) ?? client.CreateDatabase(dbName);
        string tableName = Settings.Default.WorkSheet;

        var t = db.GetTable<ActivityLog>(tableName) ?? db.CreateTable<ActivityLog>(tableName);
        var all = t.FindAll();

        t.Add(this);
    }