Looping through data adapter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #1

    Looping through data adapter

    Hi

    I have a data adapter bound to a table. How can I loop through the table via
    and access each record's column values on the way?

    Thanks

    Regards


  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: Looping through data adapter

    What kind of table are you binding to? If it is a standard .NET control,
    everyone I know has a Data bind method of some sort where you can query
    values as the form is loaded.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************** *************** *************** ****
    Think outside of the box!
    *************** *************** *************** ****
    "John" <John@nospam.in fovis.co.ukwrot e in message
    news:%233nDxyry GHA.3428@TK2MSF TNGP02.phx.gbl. ..
    Hi
    >
    I have a data adapter bound to a table. How can I loop through the table
    via and access each record's column values on the way?
    >
    Thanks
    >
    Regards
    >
    >

    Comment

    • William \(Bill\) Vaughn

      #3
      Re: Looping through data adapter

      A "data adapter" can't really be bound to anything. You can bind to the
      DataSet populated by a DataAdapter or bind to the underlying DataTables.
      The DataTable object can be addressed by iterating through the Rows
      collection as in

      For each dr as DataRow in myDataSet.Table s("MyTableName" ).Rows

      Next
      The individual columns are referenced through the DataRow Item "property"
      which can be addressed by name or ordinal (number).

      I suggest picking up any one of the dozens of books on ADO.NET. Even my
      (relatively old) ADO and ADO.NET Examples and Best Practices discusses these
      basics.

      hth

      --
      _______________ _______________ ______
      William (Bill) Vaughn
      Author, Mentor, Consultant
      Microsoft MVP
      INETA Speaker
      Welcome to the home of William Vaughn's Imagination, creations, and advice.

      Welcome to the home of William Vaughn's Imagination, creations, and advice.

      Please reply only to the newsgroup so that others can benefit.
      This posting is provided "AS IS" with no warranties, and confers no rights.
      _______________ _______________ ____

      "John" <John@nospam.in fovis.co.ukwrot e in message
      news:%233nDxyry GHA.3428@TK2MSF TNGP02.phx.gbl. ..
      Hi
      >
      I have a data adapter bound to a table. How can I loop through the table
      via and access each record's column values on the way?
      >
      Thanks
      >
      Regards
      >
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Looping through data adapter

        John,

        Do you read replies to these newsgroups?



        Now Bill is using time to write in another way the same as I did.

        Cor


        "John" <John@nospam.in fovis.co.ukschr eef in bericht
        news:%233nDxyry GHA.3428@TK2MSF TNGP02.phx.gbl. ..
        Hi
        >
        I have a data adapter bound to a table. How can I loop through the table
        via and access each record's column values on the way?
        >
        Thanks
        >
        Regards
        >
        >

        Comment

        Working...