kindly help me how to loop .net dataset?
Code:Table1.First;
while not Table1.EOF do begin
ListBox1.Items.Add(Table1['NAME']);
Table1.Next;
end;
[Title added—please give your threads a title. — Mod]
Printable View
kindly help me how to loop .net dataset?
Code:Table1.First;
while not Table1.EOF do begin
ListBox1.Items.Add(Table1['NAME']);
Table1.Next;
end;
[Title added—please give your threads a title. — Mod]
This code will display every value in every row of every table in your DataSet. Adapt it to get only the bits you need:Code:foreach (DataTable table in myDataSet)
{
foreach (DataRow row in table)
{
foreach (DataColumn column in table)
{
MessageBox.Show(row(column.ColumnName).ToString());
}
}
}