顯示 個為幫忙看看啦﹗﹗這個問題困擾我好多天了.net中只能通過Response.Write顯示數據成報表樣式 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那你可以通过Response.Write循环输出HTML不就行了吗如StringBuilder sb = new StringBuilder();sb.AppendLine("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");for (int i=0; i<3; i++){ sb.AppendLine("<tr>"); sb.AppendLine("<td>"); sb.AppendLine(i.ToString()); sb.AppendLine("</td>"); sb.AppendLine("</tr>");}sb.AppendLine("</table>");Response.Write(sb.ToString()); 样的呀,循环查询出来的DataTable呀 我寫到下面就寫不出來了﹐如何繼續 protected void btnSee_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = (new EXPENSE()).SelectAllEXPENSE(); Response.Write(" " + " <table id='td' border='1' cellspacing='1' cellpanding='1' style='width:556px;height:66px;text-align:center;' > " + " <tr> " + " <td rowspan='2' style='width:100px'> " + " 鋪號 " + " </td> " + " <td colspan=4' style='text-align:center'> " + " 2008 年3月收入 " + " </td> " + " <td colspan='4' style='text-align:center'> " + " 2008年4月收入 " + " </td> " + " <td rowspan='2' style='width:100px'> " + " 合計 " + " </td> " + " </tr> " + " <tr> " + " <td style='width:100px: height:21px'> " + " 租金 " + " </td> " + " <td style='width:100px;height:21px'> " + " 清潔費 " + " </td> " + " <td style='width:100px;height:21px'> " + " 管理費 " + " </td> " + " <td style='width:100px;height:21px'> " + " 小計 " + " </td> " + " <td style='width:100px;height:21px'> " + " 租金 " + " </td> " + " <td style='width:100px;height:21px'> " + " 垃圾 " + " </td> " + " <td style='width:100px;height:21px'> " + " 水費 " + " </td> " + " <td style='width:100px;height:21px'> " + " 管理 " + " </td> " + " </tr> "); //for (int i = 0; i <= ds.Tables["EXPENSE"].Rows.Count -1; i++) //{ // for (int j = 0; j <=ds.Tables["EXPENSE"].Columns.Count -1 ; j++) // { // //int k = 1; // TextBox1.Text=ds.Tables["EXPENSE"].Rows(i)(j); // Response.Write(ss); // } //} } 数组循环 一个最简的控制台程序,program类,如何实例化的呢?难道不需要实例化吗? 谁有好的代码 给我点啊 C#命令钮缺省选中是哪个属性 谁给我解释下 如何提高MSSQL检索速度 怎样取得 DataGrid 中 CurrentCell 里的值啊 - 急,在线等 提一个问题?谢谢 httpwebrequest 提交 失败,不知道什么原因哦! 我往DATAGRID增加一个TEXTBOX后,在往里面输入字符,在一个BUTTON的单击事件中取它的值,取不出来,这是怎么回事啊 C#的列表控件是哪个? 请问一下实体类,怎么表示 sql2005 中的image 数据啊!!!?
如StringBuilder sb = new StringBuilder();
sb.AppendLine("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
for (int i=0; i<3; i++)
{
sb.AppendLine("<tr>");
sb.AppendLine("<td>");
sb.AppendLine(i.ToString());
sb.AppendLine("</td>");
sb.AppendLine("</tr>");}
sb.AppendLine("</table>");Response.Write(sb.ToString());
protected void btnSee_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds = (new EXPENSE()).SelectAllEXPENSE();
Response.Write(" " +
" <table id='td' border='1' cellspacing='1' cellpanding='1' style='width:556px;height:66px;text-align:center;' > " +
" <tr> " +
" <td rowspan='2' style='width:100px'> " +
" 鋪號 " +
" </td> " +
" <td colspan=4' style='text-align:center'> " +
" 2008 年3月收入 " +
" </td> " +
" <td colspan='4' style='text-align:center'> " +
" 2008年4月收入 " +
" </td> " +
" <td rowspan='2' style='width:100px'> " +
" 合計 " +
" </td> " +
" </tr> " +
" <tr> " +
" <td style='width:100px: height:21px'> " +
" 租金 " +
" </td> " +
" <td style='width:100px;height:21px'> " +
" 清潔費 " +
" </td> " +
" <td style='width:100px;height:21px'> " +
" 管理費 " +
" </td> " +
" <td style='width:100px;height:21px'> " +
" 小計 " +
" </td> " +
" <td style='width:100px;height:21px'> " +
" 租金 " +
" </td> " +
" <td style='width:100px;height:21px'> " +
" 垃圾 " +
" </td> " +
" <td style='width:100px;height:21px'> " +
" 水費 " +
" </td> " +
" <td style='width:100px;height:21px'> " +
" 管理 " +
" </td> " +
" </tr> ");
//for (int i = 0; i <= ds.Tables["EXPENSE"].Rows.Count -1; i++)
//{
// for (int j = 0; j <=ds.Tables["EXPENSE"].Columns.Count -1 ; j++)
// {
// //int k = 1;
// TextBox1.Text=ds.Tables["EXPENSE"].Rows(i)(j);
// Response.Write(ss);
// }
//}
}