Closed GoogleCodeExporter closed 9 years ago
Please use Fiddler to capture the HTTP traffic and inspect the response, it
will contain a more descriptive error message telling why the request failed.
You can also get the same error message by drilling down into the exception.
Original comment by ccherub...@google.com
on 24 Nov 2012 at 6:59
[deleted comment]
[deleted comment]
Can't you help me about the problem by seeing my code provided in the section
"Please provide any additional information below."? I am getting error at last
line i.e. "service.Insert(listFeed, row);". If there is any wrong in code just
let me know, till time I check with fiddler. Your help is highly appreciable.
Thanks for your help!!
Original comment by dhananja...@clariontechnologies.co.in
on 26 Nov 2012 at 4:11
When using the List feed, the first row of the worksheet is used as the header
row. That means your code has to address the columns with the names that are
listed in the first row.
You are using "Name" and "URL" as the column names in your code. Does the
spreadsheet have those values in the first row? If not, your insert request
will fail.
I'm closing this as working as intended, if that is not the case I need the
HTTP capture to understand what is not working in your code and reopen the
issue.
Original comment by ccherub...@google.com
on 26 Nov 2012 at 4:16
As you have suggested I have checked the response in the fiddler but I didn't
get any. I get innerexception while debugging in the visual studio. Inner
exception says, "The remote server returned an error: (400) Bad Request.".
Comment on your comment 5:
I don't have anything in newly inserted worksheet. I am trying to insert a
firstrow with the following code and I am getting the above exception.
// Define the URL to request the list feed of the worksheet.
AtomLink listFeedLink =
worksheet.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null);
// Fetch the list feed of the worksheet.
ListQuery listQuery = new ListQuery(listFeedLink.HRef.ToString());
ListFeed listFeed = service.Query(listQuery);
// Create a local representation of the new row.
ListEntry row = new ListEntry();
row.Elements.Add(new ListEntry.Custom() { LocalName = "Name", Value = "Name" });
row.Elements.Add(new ListEntry.Custom() { LocalName = "URL", Value = "URL" });
// Send the new row to the API for insertion.
service.Insert(listFeed, row);
Now tell me how shall I insert my first row in the worksheet? I am following
the code from the link
"https://developers.google.com/google-apps/spreadsheets/#adding_a_list_row"
Please help me.
Original comment by dhananja...@clariontechnologies.co.in
on 26 Nov 2012 at 5:37
See the following links. There also people didn't get solution to insert a row
in worksheet of google:
http://stackoverflow.com/questions/10518694/adding-a-row-to-a-google-spreadsheet
http://stackoverflow.com/questions/13008293/exception-during-adding-a-row-to-goo
gle-spreadsheet
How can you say that everything is fine?
One more thing I am not able to reopen the issue. You check it.
Original comment by dhananja...@clariontechnologies.co.in
on 26 Nov 2012 at 5:53
In the second Stack Overflow question you linked I explained how the list-based
feed of the Spreadsheets API works. Basically, this feed can only be used when
the spreadsheet has a know structure (i.e. header row).
Original comment by ccherub...@google.com
on 26 Nov 2012 at 5:07
I was having a similar issue and found that the LocalName must be all in lower
case. So, in your case try the following:
row.Elements.Add(new ListEntry.Custom() { LocalName = "name", Value = "Name" });
row.Elements.Add(new ListEntry.Custom() { LocalName = "url", Value = "URL" });
Apparently spaces should also be removed from the column names.
http://eveinfo.net/wiki/refer~17.htm#gsx_reference
I wish I could find this in Google's own documentation. It's probably there
somewhere, but way too hard to track down.
Hope this helps,
Matt
Original comment by matheson...@gmail.com
on 2 Apr 2013 at 5:39
Original issue reported on code.google.com by
dhananja...@clariontechnologies.co.in
on 24 Nov 2012 at 11:44