Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ADO to ADO.net question

ADO to ADO.net question

Scheduled Pinned Locked Moved C#
questioncsharpsysadmintutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Steve Messer
    wrote on last edited by
    #1

    I am trying to use some VB code in C# and being very new to databases I can't figure out the following.

    Private Sub Connect_Click() 
     
    Dim con As ADODB.Connection 
    Dim recordset As ADODB.recordset 
    Dim constr As String 
    
    Set con = New ADODB.Connection 
     
    con.Provider = "ADPProv.ADPProv.1" 
    
    constr = "host=" & Host.Text 
    constr = constr & ";product=" & Product.Text 
    constr = constr & ";server=" & Server.Text 
    constr = constr & ";pooling=TRUE" 
     
    con.Open constr, "", Password.Text 
     
    con.Properties("GROUP") = "ADMIN" 
     
    Set recordset = con.Execute("Object",,adCmdTableDirect) 
     
    
    Do Until recordset.EOF 
     With Output 
      For Each Field In recordset.Fields 
      .AddItem Field.Name & "=" & recordset(Field.Name) 
      Next 
      .AddItem"" 
    
     End With 
     Recordset.MoveNext 
     Loop 
    End Sub 
    Private Sub Data1_Validate(Action as Integer, Save As Integer) 
    End Sub 
    

    I am using:

    string constr = string.Format("provider=ADPProv.ADPProv.1;host={0};product={1};server={2};password={3};group=ADMIN;polling=TRUE",
    	tBox_HostInfo.Text,
    	tBox_ProductInfo.Text,
    	tBox_ServerInfo.Text,
    	tBox_PasswordInfo.Text);
    
    
    OleDbConnection con = new OleDbConnection();
    con.ConnectionString = constr;
    

    I don't know how to reproduce this section of VB code:

    con.Properties("GROUP") = "ADMIN" 
    

    What is this doing? Thanks

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups