Pass Dataset to scraping session from .net program
Hi,
I am trying to pass a Screenscraper dataset as a session variable from a .net c# program. Is this possible or will I have to use just text session variables? It would be easier to be able to pass a dataset into the session as a variable and then delete datarecords from the dataset. I don't see a method for adding a datarecord from the screenscraper.dataset in c# .Net.
And if you can then when you add a datarecord to a dataset is the datarecord stored in the last position of the dataset or the first?
Thanks in advance,
Seamus
Cheers Scot,I just use
Cheers Scot,
I just use nested loops instead.
Thanks,
Seamus
Hi Scott, Thanks for the
Hi Scott,
Thanks for the quick reply. When trying to add a datarecord to the screenscraper dataset in c# .net there is no method available to add the record to the screenscraper dataset. But I have another problem. I tried going to long route and just add datarecords individually by setVariable but I get an error. The exact code is.
The name variableName is a dynamic variable name but this is isn't the problem I checked it.
remoteScrapingSession.SetVariable(variableName, adRecordScraper);
I get an error: the best overload method match for Screenscraper.RemotescrapingSession.SetVariable(string, string) has some invalid arguments
And
cannot convert from Screenscraper.DataRecord to string
It only allow me to put input a string which makes things alot more complicated. I am using remotescrapingsession.dll Version 1.1.0.0
Any help would be really appreciated.
Seamus, I'm sorry, but I
Seamus,
I'm sorry, but I misspoke. You cannot pass DataSets to screen-scraper via .NET. Instead you will, as you say, have to pass to screen-scraper individual variables as strings via SetVariable.
You are, however, able to retrieve data as DataSets from screen-scraper via your .NET app. You do so by calling GetVariable. You then have different methods for working with the DataSet from within .NET.
-Scott
Seamus, You would need to add
Seamus,
You would need to add all data records to your data set prior to saving your dataSet as a session variable. Once saved as a session variable it can either be set to null or overwritten but can not be appended to.
-Scott