简体   繁体   English

在Google电子表格中插入行

[英]Insert rows into google spreadsheet

I need to insert rows into Google spreadsheet. 我需要在Google电子表格中插入行。 Below is the code which I am using but not able to insert rows. 下面是我正在使用但无法插入行的代码。 There is no build issue. 没有构建问题。 Compilation was successfull. 编译成功。

 SpreadsheetsService GoogleExcelService =  new SpreadsheetsService("GoogleSheet");

        protected void Page_Load(object sender, EventArgs e)
        {
            //Pass Google credentials 
            GoogleExcelService.setUserCredentials("user@gmail.com", "password");

            ListEntry entry = new ListEntry();
            //Add new row data with productname bottles and quantity 100.
            entry.Elements.Add(new ListEntry.Custom() { LocalName = "productname", Value = "Bottles" });
            entry.Elements.Add(new ListEntry.Custom() { LocalName = "quantity", Value = "100" });

            //AtomEntry retEntry = GoogleExcelService.Insert(

            AtomEntry retEntry = GoogleExcelService.Insert(new Uri("***WHAT URI I SHOULD PROVIDE HERE"), entry);
        }
    }

I had already spent too much time on this to figure out the issue but no luck. 我已经花了很多时间来解决这个问题,但是没有运气。 I am getting the "Execution of authentication request returned unexpected result: 404" error. 我收到“执行身份验证请求返回了意外结果:404”错误。 Please help. 请帮忙。

Are you using OAuth1.0? 您正在使用OAuth1.0吗? Based on a ticket submitted last May 2015, OAuth1.0 is now deprecated (as of May 2015) and should be migrated to OAuth2.0 use. 根据2015年5月提交的票证 ,OAuth1.0现在(自2015年5月起)已弃用,应迁移到OAuth2.0使用。 It seems to return the same error message you're encountering. 似乎返回了您遇到的相同错误消息。

More information about OAuth2.0 usage can be seen on the developer page . 有关OAuth2.0使用情况的更多信息,请参见开发人员页面

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Google电子表格中插入标题? - How to insert headers in google spreadsheet? 将列和行从IQueryable对象插入电子表格 - Insert Columns and Rows into spreadsheet from IQueryable object 如何在Google电子表格的中间插入一行 - how to insert a row in the middle of a google spreadsheet 如何将现有的Google工作表插入Google电子表格? - How can I insert an existing Google Worksheet into a Google Spreadsheet? 使用oleDbCommand在C#中将行插入Excel电子表格的更快方法? - Faster way to insert rows into Excel spreadsheet in C# using oleDbCommand? 如何使用C#在Google电子表格中插入一行 - How do I insert a row in to a Google spreadsheet using c# Google电子表格和Sheets Api返回的行数有限 - Limited number of rows returned from Google spreadsheet and the Sheets Api 您如何根据列值从 excel 电子表格中 select 行并将其插入 dataGridViews? - How do you select rows from an excel spreadsheet based off of a column value and insert it into dataGridViews? 你如何填写清单<request> () 用于 BatchUpdateSpreadsheetRequest 更新 C# 中谷歌电子表格中的多行/列/单元格</request> - How do you fill a List<Request>() for a BatchUpdateSpreadsheetRequest to update multiple rows/columns/cells in a google spreadsheet in C# 向谷歌电子表格添加一行 - Adding a row to a google spreadsheet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM