Learning ADO+

Results 1 to 2 of 2

Thread: Learning ADO+

  1. #1
    Joel M Guest

    Default Learning ADO+

    hi,<BR> I can&#039t find anything anywhere about how to access specific fields in a dataset... or how to iterate through that dataset...<BR><BR>I&#039ve found numerous articles on databinding it to a datagrid... but I don&#039t want to databind it... I want it to have the same functionality as an oldschool recordset where I can sprinkle values from the dataset around the ASP page....<BR><BR>thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default Figured It Out

    Got It!<BR><BR>far as I can tell, there&#039s no .movenext type of method for the dataset. but you can loop through it and use the values as you wish using a "For Each" loop... like this:<BR>-----------------<BR>Dim Conn as ADOConnection<BR>conn = New ADOConnection("dsn=LocalServer;pwd=;uid=")<BR>conn .open<BR><BR>dim SQL as String = "SELECT * From Table"<BR><BR>dim DSCmd as ADODataSetCommand<BR>dim DS as ADODataSet<BR><BR>DSCmd = New ADODataSetCommand(SQL, Conn)<BR>Conn.close<BR>Conn = nothing<BR><BR>DS = new DataSet<BR>DSCmd.FillDataSet(DS, "DSName")<BR><BR>&#039** Loop Through the DataSet<BR><BR>for each item in ds.tables("dsName").rows<BR> response.write(item("ColumnName").tostring() & "---&#062; ")<BR>next<BR>------------------<BR><BR>the point of that is that you canuse any of the column of the dataset in any order you wish...<BR><BR>Hope it Helps someone else<BR>Joel Martinez

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts