944,155 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 1864
  • VB.NET RSS
Aug 21st, 2006
0

Going from ASP 3.0 to VB.NET

Expand Post »
I am working on a personal project as part of learning ASP.Net and I can not figure out how to do this. I have code that is VB for ASP 3.0 and trying to translate it to ASP.NET. It reads data for a MySql Database and displays it on the page. (Actually reading from a PhpBB forum as part of a Latest News type listing on Main Site Page). I have searched and every example I find can not get it to work. Would really like to keep it in VB.NET as it would be easy then to incorporate with rest of site. Have tried to make it as a web page all to itself and even as a Web User Control (which would be really great). So really getting frustrated and any help would be appreciated, whether it be code example, site with tutorial or even a Book that I could go get.

Thanks in advance for everything.

The code is as follows:
VB.NET Syntax (Toggle Plain Text)
  1. <%@ Language="VBScript" %>
  2.  
  3. ' Include Ado Utilities for Connections and data manipulation
  4. <!-- #include file="modAdoUtils.asp" -->
  5.  
  6. <%
  7. Dim m_arrRecords ' Array to hold news info
  8. Dim m_i ' Record Counter
  9. Dim m_objAdoRs ' Recordset to draw the data from the DB
  10.  
  11. ' Open the database connection
  12. Call OpenConnection()
  13.  
  14. ' Get records into the recordset
  15. Set m_objAdoRs = GetRecordSet("select n.post_subject, n.post_text from eq_posts_text n,eq_posts p where n.post_id = p.post_id and p.forum_id=6",3,3)
  16.  
  17. 'Check for records
  18. If m_objAdoRs.RecordCount > 0 Then
  19. ' Save the records into an array for speed
  20. m_arrRecords = m_objAdoRs.GetRows()
  21. ' Loop through and write the News to the screen.
  22. For m_i = 0 to UBound(m_arrRecords,2)
  23. Response.Write "<b><i>" & (m_arrRecords(0,m_i)) &"</b></i>" & vbCrLf
  24. Response.Write " " & (m_arrRecords(1,m_i)) & vbCrLf
  25. Response.Write " " & vbCrLf
  26. Next
  27. Else
  28. ' No news found in table
  29. Response.Write "No News found at this time." & vbCrLf
  30. End If
  31.  
  32. ' Clean up
  33. m_objAdoRs.Close
  34. Set m_objAdoRs = Nothing
  35. Call CloseConnection()
  36. %>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
AlexC-FL is offline Offline
1 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Term Project Ideas Please
Next Thread in VB.NET Forum Timeline: Variables





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC