Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Visual Studio .NET > VS.NET General Discussion

VS.NET General Discussion Anything related to Visual Studio and not covered in a topic forum. Please use a specific forum from the list below if able!

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-05-2010, 1:55 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5
 
Join Date: Jan 2010
Age: 26
Posts: 10
Reputation: 4
mushimushi84 is on a distinguished programming path ahead
Default ListView from Array

Hey People

Ok, so I've got kind of a unique situation im looking for some solutions on.

I'm VERY NEW to vb.net. Currently I have developed some code for crawling wep pages for specific content. I have a unique regex for each website and it collects information - ie: title, pictures, viewtime etc.

So far I've collected all of these into an array and displayed the results on my site using innerhtml which works just fine. The problem is I would like to bind this data (In the multidimensional array) to a LISTVIEW ASP control. Reason being I want to harness the power of the DATAPAGER so all the results are not on one page.

Also currently everytime a result is found, i ReDim Preserve the array to make it one bigger, but i've been told this is very memory consuming and not a good idea. I've also looked into ArrayLists, but they don't come multidimensional.

I also want to sort these results by different columns in the array and redisplay them on the page.

So I guess my questions are:

Is using an Array/Array List the best way to store these results at runtime?

If So, how do I databind my ListView to a multidimensional array?

Am i completely missing some obvious solution? lol thx

Here's a code snippet from searching youtube for results

The arrResults() is publicly declared



Code:
Public Function SearchYouTube() As Integer


        '<a class="video-thumb-120" href="/watch?v=QI7e5cPFe1g"   ><img title="asdf"    src="http://i2.ytimg.com/vi/QI7e5cPFe1g/default.jpg"
        Dim strSearchIn As String = GetPageHTML("http://www.youtube.com/results?search_query=" & strSearch & "&search_type=&aq=f")
        Dim R As New Regex("<a\sclass=""video-.*""\shref="".*"".*><img\stitle="".*"".*="".*\.jpg""")

        Dim RCount As MatchCollection = R.Matches(strSearchIn)

             For Each M As Match In R.Matches(strSearchIn)
            CountMatchNumberOfM = CountMatchNumberOfM + 1


            Dim wordColl As MatchCollection = Regex.Matches(M.Value.Split("""").GetValue(7), "gif")
            Dim strPic As String = ""

            If wordColl.Count > 0 Then
                strPic = M.Value.Split("""").GetValue(9)
            Else
                strPic = M.Value.Split("""").GetValue(7)
            End If

            Dim strHref As String = "<a target='_blank' href = ""http://www.youtube.com" & M.Value.Split("""").GetValue(3) & """>"
            Dim strDesc As String
            strDesc = M.Value.Split("""").GetValue(5)

            If strDesc.Length > 25 Then
            End If

            Dim strLink As String
            strLink = strHref & strDesc & "</a>" & "<br />"

            Dim strSite As String = "You Tube"
            Dim resultdivs As String = CreateDisplayDivs(strPic, strLink, strSite, strHref)

            If arrResults Is Nothing Then
                ReDim arrResults(0)
            Else
                ReDim Preserve arrResults(0 To arrResults.Length)
            End If

            arrResults(arrResults.Length - 1) = resultdivs


        Next

    End Function
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-05-2010, 1:58 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5
 
Join Date: Jan 2010
Age: 26
Posts: 10
Reputation: 4
mushimushi84 is on a distinguished programming path ahead
Default

Edit:

I know this array isn't multidimensional, but in order to sort the results I'm going to have to make it so.

Currently the results are passed to CreateResultDivs which combines the results passed to it with <div> and other html tags that i throw in the pages innerhtml currently
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 5:50 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.