Click here to Skip to main content
15,914,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
pradiprenushe 22-Aug-12 1:26am    
not clear
asok6783 22-Aug-12 1:50am    
i want to create a row in ui on a button click event depending the value on the db table until it becomes zero
[no name] 22-Aug-12 1:29am    
make question clear plz whether u need to create in db or create in UI?
asok6783 22-Aug-12 1:49am    
i want to create a row in ui on a button click event depending the value on the db table until it becomes zero

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
 
Share this answer
 
Take html table control on .aspx page and write below code on .cs page.

C#
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!!!!! :)
 
Share this answer
 
U can also use like this!!!

Below are the sample coding....

XML
StringBuilder SB = new StringBuilder();
        SB.Append("<table id='ProductModel' border='0'><tr><td width='91' style='text-align:center;'><b>Size</b></td>");
        SB.Append("<td width='87' style='text-align:center;'><b>Price in INR</b></td><td width='90' style='text-align:center;'><b>Time To Ship</b></td></tr>");
        for (int i = 0; i < dataTable.Rows.Count; i++)
        {            
            SB.Append("<td style='text-align:center;'>"+dataTable.Rows[i]["column_name1"].ToString()+" </td>");
            SB.Append("<td style='text-align:center;'>"+ dataTable.Rows[i]["column_name2"].ToString() +" </td>");
            SB.Append("<td style='text-align:center;'>"+ dataTable.Rows[i]["column_name3"].ToString() +" </tr>");
        }
        SB.Append("</table>");
        Models.InnerHtml = SB.ToString();


VB
Good luck.

Thanks,
~~Karthik.J~~
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900