如何根据数据库表中的值创建动态表 [英] how to create dynamic table depending on values in database table

查看:95
本文介绍了如何根据数据库表中的值创建动态表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个oracle表,其中一个值是从收银员那里收到的金额,我必须提交帐户详细信息.例如,如果我收到5000卢比,则必须详细提及5000/-rs的支出,我已根据余额创建了附加行.

i am having an oracle table in which one of the value is the amount received from cashier i have to submit the account details. For example if i receive 5000 rs i have to mentioned in details the expenditure for the amount of 5000/-rs i have create the addtional row depending on the balance

推荐答案



看看 MSDN文章 [
Hi,

Have a look at MSDN Article[^]

You can create any server control or html control dynamically. You can also add your dynamically created control in your page. you only need to create an instance of that control and add in the page with data.

Good luck.

Thanks
-Amit Gajajr


看看这些链接..您将了解如何根据数据库值创建动态表.
http://www.aspdotnet-suresh.com/2012/07/aspnet-save-dynamically-created-control.html [ ^ ]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=135 [ ^ ]
http://stackoverflow.com/questions/9835209/creating- a-dynamic-custom-datagrid-using-table-and-label [
Have a look these links..you will have an idea how to create dynamic table depending on database values.
http://www.aspdotnet-suresh.com/2012/07/aspnet-save-dynamically-created-control.html[^]
http://www.dotnetcurry.com/ShowArticle.aspx?ID=135[^]
http://stackoverflow.com/questions/9835209/creating-a-dynamic-custom-datagrid-using-table-and-label[^]


在.aspx页上执行html表控件,并在.cs页面.

Take html table control on .aspx page and write below code on .cs page.

DataTable DT = new DataTable();
//Your DT biding code goes here 
            HtmlTableRow TR;
            HtmlTableCell TD;
 //You can Iterate loop here to check ur logic i.e.until the value becomes zero
            if (DT.Rows.Count>0)
            {
            TR = new HtmlTableRow();
            TD = new HtmlTableCell();
            TD.InnerHtml = " Branch Code";
            TD.Align = "Left";
            TD.Style[HtmlTextWriterStyle.FontSize] = "11px"; 
            TR.Cells.Add(TD);
            tblRpt.Rows.Add(TR);
 
            TD = new HtmlTableCell();
            TD.InnerHtml = " Branch Name";
            TD.Align = "Left";
            TD.Style[HtmlTextWriterStyle.FontSize] = "11px";
            TR.Cells.Add(TD);
            tblRpt.Rows.Add(TR);
 
 
            TD = new HtmlTableCell();
            TD.InnerHtml = " Branch State";
            TD.Align = "Left";
            TD.Style[HtmlTextWriterStyle.FontSize] = "11px";
            TR.Cells.Add(TD);
            tblRpt.Rows.Add(TR); 
        }


谢谢!!!
祝您编码愉快!!!! :)


Thanks!!!
Happy Codeing!!!!! :)


这篇关于如何根据数据库表中的值创建动态表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆