c# - php developer needs help in asp.net tables -
c# - php developer needs help in asp.net tables -
i humbly need help. php developer learning asp.net c# requirement of our company. familiar basics of c# , oops. problem facing learned how retrieve values database , create info table know can bind grid command display info technique restricts me of own stuff datagrid want used hard code table in php if needed build table like
<?php */ retrive info database , store in array using $row_sql = mysql_fetch_array() function /* .... .... ?> <table> <tr> <td><?php $row_sql['fieldname']; ?></td> </tr> .... .... </table> ?>
i know can such thing repeater not sure want utilize such command or because not familiar asp.net style.
so can please guide me how can this. or please tell me should larn asp.net if know how in php?
update: ok here did still getting error
firstly created databale filling dataset dataadapter. used code suggested getting next error: foreach statement cannot operate on variables of type 'system.data.datatable' because 'system.data.datatable' not contain public definition 'getenumerator'
you're not limited using grid controls @ disposal - can generate own markup looping through info rows in specific info table. can instance this:
<% foreach (datarowview dr in mydatatable.asdataview()) { response.write("<tr>"); response.write("<td>" + dr["column1"].tostring() + "</td>"); response.write("<td>" + dr["column2"].tostring() + "</td>"); response.write("<td>" + dr["column3"].tostring() + "</td>"); response.write("</tr>"); } %>
that loop through each info row in info table , write out contents of columns 1-3 (assuming names "column1", "column2" , "column3", of course), each in own td, wrapped in tr. i'm sure figured out already...
my suggestion rather implement mvc framework (whether asp.net mvc framework or own), easier adapt, coming php background.
edit updated code snippet utilize dataview type enumeration... remember include system.data namespace utilize "asdataview()" extension method. alternatively, dataview follows:
<% foreach (datarowview dr in new dataview(mydatatable)) { // code... } %>
c# php asp.net table
Comments
Post a Comment