Question : View generated source with vb.net httpwebrequest

Hey guys,

I need to grab a string from a web page but it's dynamically generated with javascript so I was wondering if it's even possible to get the generated source (after running javascript) with httpwebrequest in vb.net

Any help is appreciated, thanks in advance.

Answer : View generated source with vb.net httpwebrequest

Hi jxbma;

The query you are trying to execute and fill its results into a DataTable with will not work. The syntax for the CopyToDataTable is as follows :

Public Shared Function CopyToDataTable(Of T As DataRow) ( _
      source As IEnumerable(Of T) _
) As DataTable

But what you have is the following :

var query = (from pax in ListOfItems
                   from pInfo in Information
                   where pax.Value == pInfo.Key.TravelerID
                   select new { pax.Key.FirstName,
                                        pax.Key.LastName,
                                        pax.Key.IsFreePlace,
                                        pInfo.Value });

Which the type of the query is of Anonymous type as can be seen from the select clause where you use the keyword new without a type. When you query two List the results is of some List or IEnumerable. There is no function that will convert a List to a DataRow of a DataTable.

The solution will be to loop through the results and create a DataRow from the DataTable for each element of the result set.

Fernando

Random Solutions  
 
programming4us programming4us