xbabigyrlx
08-08-2006, 04:59 PM
What I need to do is display a table or a datagrid with info generated from a stored procedure. The problem is that the heading of the table or grid can't be hardcoded. The information is generated based on the current month so as the months go by the data and the headings will change to accomodate that... I originally did this in a coldfusion project and need to convert it to asp.net with c#.... Here is the code I used in coldfusion so you can get an idea of what I am trying to do...
<cfoutput>
<table >
<cfloop from="-10" to="1" index="iCount" >
<cfset iMonth = #DateFormat(Now(), "MMM YY")# >
<cfset nMonth = #DateAdd('M', iCount, iMonth)#>
<cfset fMonth = #DateFormat(nMonth, "MMM YY")#>
<td><div align="right"><strong>#fMonth#</strong></div></td>
</cfloop>
<cfloop query = "qCurCharges">
<th scope="row">#qCurFuelSurcharges.FCCode#</div></th>
<td><div align="right">#qCurCharges.Rate10#</div></td>
<td><div align="right">#qCurCharges.Rate9#</div></td>
<td><div align="right">#qCurCharges.Rate8#</div></td>
<td><div align="right">#qCurCharges.Rate7#</div></td>
</cfloop>
</table>
</cfoutput>
How do I do this in asp.net with c#? Thanks for any help in advance.
<cfoutput>
<table >
<cfloop from="-10" to="1" index="iCount" >
<cfset iMonth = #DateFormat(Now(), "MMM YY")# >
<cfset nMonth = #DateAdd('M', iCount, iMonth)#>
<cfset fMonth = #DateFormat(nMonth, "MMM YY")#>
<td><div align="right"><strong>#fMonth#</strong></div></td>
</cfloop>
<cfloop query = "qCurCharges">
<th scope="row">#qCurFuelSurcharges.FCCode#</div></th>
<td><div align="right">#qCurCharges.Rate10#</div></td>
<td><div align="right">#qCurCharges.Rate9#</div></td>
<td><div align="right">#qCurCharges.Rate8#</div></td>
<td><div align="right">#qCurCharges.Rate7#</div></td>
</cfloop>
</table>
</cfoutput>
How do I do this in asp.net with c#? Thanks for any help in advance.