VB Code:
  1. Dim oRec As ADODB.Record
  2.     Dim sUrl As String
  3.     Dim sSQL As String
  4.     Dim oRst As ADODB.Recordset
  5.  
  6.     Dim Flds As ADODB.Fields
  7.     Dim Fld As ADODB.Field
  8.    
  9. Private Sub Command1_Click()
  10.  
  11.     sUrl = "http://smtp.mywebsite.com/public/New Projects"
  12.  
  13.     sSQL = "select "
  14.     sSQL = sSQL & " ""DAV:contentclass"""
  15.     sSQL = sSQL & ", ""urn:schemas:contacts:o"" "
  16.     sSQL = sSQL & ", ""DAV:href"" "
  17.     sSQL = sSQL & ", ""DAV:displayname"" "
  18.     sSQL = sSQL & ", ""DAV:company"" "
  19.     sSQL = sSQL & " from scope ('shallow traversal of " & Chr(34)
  20.     sSQL = sSQL & sUrl & """') "
  21.     sSQL = sSQL & " WHERE ""DAV:ishidden"" = false "
  22.     sSQL = sSQL & " AND ""urn:schemas:contacts:o"" LIKE '%dim%' "
  23.    
  24.     oRec.Open sUrl, , adModeRead
  25.     oRst.Open sSQL, oRec.ActiveConnection
  26.     List1.AddItem "Public Folders :"
  27.     Do While Not oRst.EOF
  28.     List1.AddItem oRst.Fields("DAV:href")
  29.         oRst.MoveNext
  30.     Loop
  31.     oRst.Close
  32.     oRec.Close
  33.  
  34. End Sub
  35.  
  36. Private Sub Form_Load()
  37.     Set oRec = CreateObject("ADODB.Record")
  38.     Set oRst = CreateObject("ADODB.Recordset")
  39. End Sub


I'm trying to convert that from VB6 to .NET but I keep getting this error in .net:

Code:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: 

Source Error: 


Line 49:         sSQL = sSQL & " AND ""urn:schemas:contacts:o"" LIKE '%dim%' "
Line 50: 
Line 51:         oRec.Open(sUrl, , ADODB.ConnectModeEnum.adModeRead)
Line 52:         oRst.Open(sSQL, oRec.ActiveConnection)
Line 53:         list1.Items.Add("Public Folders :")

Any ideas guys?

thanks in advance,

Dimava