I have a labels that need values retreieved from a Database.
I am able to query the database but how can I extract values from a DataTable and place them in the appropiate labels
Thanks
I have a labels that need values retreieved from a Database.
I am able to query the database but how can I extract values from a DataTable and place them in the appropiate labels
Thanks
In DataTable you have rows and columns. To select a particular cell you need to do this:
This will set the label1 text to Row 0, Column 0 value.
To iterate through each row use:
This will print values for columns against each row. In this code you need to replace string for columnname (e.g. ColumnName1) with your column names
Example of how you retrieve a value from the first row and the column named "MyFirstColumn":