Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
google文档电子表格asp.net_Asp.net_Google Spreadsheet Api_Newrow - Fatal编程技术网

google文档电子表格asp.net

google文档电子表格asp.net,asp.net,google-spreadsheet-api,newrow,Asp.net,Google Spreadsheet Api,Newrow,我正在使用.net的google docs电子表格API,我想使用asp.net C插入新的一行google docs,我无法这样做 任何人都可以帮助我???如果你发布了你已经拥有的代码,那么我们可以专门帮助你 根据谷歌开发者指南(): 添加一行 要在基于列表的提要中插入新行,请首先构造一个新的ListEntry,并将其Elements属性设置为包含行中的单元格。例如,给定表示现有行的ListEntry,您可能会提示用户输入每列的值,如下所示: ListEntry newRow = new Li

我正在使用.net的google docs电子表格API,我想使用asp.net C插入新的一行google docs,我无法这样做


任何人都可以帮助我???

如果你发布了你已经拥有的代码,那么我们可以专门帮助你

根据谷歌开发者指南():

添加一行

要在基于列表的提要中插入新行,请首先构造一个新的ListEntry,并将其Elements属性设置为包含行中的单元格。例如,给定表示现有行的ListEntry,您可能会提示用户输入每列的值,如下所示:

ListEntry newRow = new ListEntry();

foreach (ListEntry.Custom element in existingRow.Elements)
{
  Console.Write("Enter the value of column {0}: ", element.LocalName);
  String elementValue = Console.ReadLine();

  ListEntry.Custom curElement = new ListEntry.Custom();
  curElement.LocalName = element.LocalName;
  curElement.Value = elementValue;

  newRow.Elements.Add(curElement);
}
ListEntry insertedRow = feed.Insert(newRow) as ListEntry;
然后在ListFeed中插入新行,如下所示:

ListEntry newRow = new ListEntry();

foreach (ListEntry.Custom element in existingRow.Elements)
{
  Console.Write("Enter the value of column {0}: ", element.LocalName);
  String elementValue = Console.ReadLine();

  ListEntry.Custom curElement = new ListEntry.Custom();
  curElement.LocalName = element.LocalName;
  curElement.Value = elementValue;

  newRow.Elements.Add(curElement);
}
ListEntry insertedRow = feed.Insert(newRow) as ListEntry;
电子表格在基于列表的提要中显示的最后一行之后立即插入新行,也就是说,在第一个完全空白的行之前。此代码相当于向URL发送经过身份验证的POST请求:

https://spreadsheets.google.com/feeds/list/key/worksheetId/private/full
在文章正文中使用相应的XML文档


谢谢。

您应该显示您现在使用的代码-提供一些详细信息和任何错误消息。我正在尝试输入第一行,但要添加的行必须与标题行(或工作表中列标题的值)匹配。但是在整个过程中,博士。没有提到如何添加标题行?因此,我得到了一个异常400错误的请求。在google文档中:row.Elements.Add(new ListEntry.Custom(){LocalName=“Name”,Value=“joe”});,但是如何添加这个localName头呢?