I am a PHP developer but now I am learning asp.net with C# as it is a requirement of our company. I am familiar with the basics of C# and oops. The problem I am facing is that I learned how to retrieve values from the database and make a data table. Now from this I know that I can bind a grid control to display the data but this technique restricts me to do some of my own stuff to the datagrid. Now what I want is that I used to hard code the table in PHP if I needed to build a table like:
<?php
*/
retrive the data from the database and store it in an array using $row_sql = mysql_fetch_array() function
/*
....
....
?>
<table>
<tr>
<td><?php $row_sql['fieldname']; ?></td>
</tr>
....
....
</table>
?>
I know that I can do such a thing with a repeater but not sure that I want to use such a control or its just because that i am not so familiar with asp.net style.
So can anyone please guide me how can I do this? Or please tell me what should I do to learn asp.net if I know how to do it in PHP?
Update: Ok here is what I did but I am still getting an error.
Firstly I created a database by filling the dataset from dataadapter, then I used the code as suggested but I am getting the following error:
foreach statement cannot operate on variables of type 'System.Data.DataTable' because 'System.Data.DataTable' does not contain a public definition for 'GetEnumerator'