سؤال

i am using google docs spreadsheet API for .net and i want to insert new row the google docs using asp.net C# i am unable to that.

Any one can help me??

هل كانت مفيدة؟

المحلول

If you do post what code you have already then we may be able to specifically help you.

According to the Google Developer's Guide (here):

Add a row

To insert a new row in a list-based feed, first construct a new ListEntry and set its Elements property to contain the cells in the row. For example, given the ListEntry that represents an existing row, you might prompt the user for the values of each column as follows:

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);
}

Then insert the new row in the ListFeed as follows:

ListEntry insertedRow = feed.Insert(newRow) as ListEntry;

Spreadsheets inserts the new row immediately after the last row that appears in the list-based feed, which is to say immediately before the first entirely blank row. This code is equivalent to sending an authenticated POST request to the URL:

https://spreadsheets.google.com/feeds/list/key/worksheetId/private/full

with the corresponding XML document in the POST body.

Thanks.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top