Hi
When i am trying to get Tags i am getting above error.
using (var yt = new YouTubeService(new BaseClientService.Initializer()
{
ApiKey = "MyApiKey",
}))
{
StringBuilder htmlTable = new StringBuilder();
var request = yt.Videos.List("snippet");
request.Chart = VideosResource.ListRequest.ChartEnum.MostPopular;
var response = request.Execute();
var objResult = response.Items.ToList();
if (objResult != null)
{
htmlTable.Append("");
htmlTable.Append("Category Id Channel Id Channel Title Video Title Description Tags Published ");
htmlTable.Append("");
foreach (var colum in objResult)
{
htmlTable.Append("");
htmlTable.Append("" + colum.Snippet.CategoryId + " ");
htmlTable.Append("" + colum.Snippet.ChannelId + " ");
htmlTable.Append("" + colum.Snippet.ChannelTitle + " ");
htmlTable.Append("" + colum.Snippet.Title + " ");
htmlTable.Append("" + colum.Snippet.Description + " ");
htmlTable.Append("" + colum.Snippet.Tags + " ");
htmlTable.Append("" + colum.Snippet.PublishedAt + " ");
htmlTable.Append(" ");
}
htmlTable.Append("");
htmlTable.Append("
");
PlaceHolderTable.Controls.Add(new Literal { Text = htmlTable.ToString() });
}
}
Thanks
Dharmesh SharmaPosted Dec 17, 2022, 5:35 PM
Which line you are getting this error.
As per my understanding error will come in this line.
so check now.
let me know