|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Looping through data adapterHi
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 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. -- Show quoteHide quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA ************************************************* Think outside of the box! ************************************************* "John" <John@nospam.infovis.co.uk> wrote in message news:%233nDxyryGHA.3428@TK2MSFTNGP02.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 > > 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.Tables("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 -- Show quoteHide quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com 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.infovis.co.uk> wrote in message news:%233nDxyryGHA.3428@TK2MSFTNGP02.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 > > John,
Do you read replies to these newsgroups? http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/msg/df51c13d3e6742c1 Now Bill is using time to write in another way the same as I did. Cor Show quoteHide quote "John" <John@nospam.infovis.co.uk> schreef in bericht news:%233nDxyryGHA.3428@TK2MSFTNGP02.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 > > |
|||||||||||||||||||||||