如何在动态表中进行性能计算 [英] how to perfom calculation in dynamic table

查看:69
本文介绍了如何在动态表中进行性能计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在按钮单击事件中,我想获取动态表中的单元格值
然后计算该值并将其插入数据库.

下面的代码.

In the button click event, I want to get the cell value in dynamic table
and then calculate the value and insert it into the database.

Code below.

protected void btnCalc_Click(object sender, EventArgs e)
        {
            Table tblnew = new Table();
            //foreach (Control c in this.form1.Controls)
            //{
                            if (Request.Form["txt" + a] != null)
                            {
                                 txta =Convert.ToInt32(Request.Form["txt" + a]);
                                a = a + 1;
                                //break;
                            }
                            if (Request.Form["txtExR1"] != null)
                            {
                                 txtex = Convert.ToInt32(Request.Form["txtExR1"]);
                                 //Request.Form["col24"].Replace("",inr);
                            }
                            if (Request.Form["lbl24"] != null)
                            {
                             string ss=   Request.Form["lbl24"].Insert(0, "econ");
                            }
                            if (Request.Form["col24"] != null)
                            {
                                Request.Form["col24"].Insert(0, "econ");
                            }
                                 //l.Text = inr;
                            string usd = (txta * Convert.ToInt32(lblq1.Text)).ToString();
                            string cal = (txta * txtex).ToString();

                            lctxt.Value = cal;
                            //dpnl.Visible = true;


            //}
            dpnl.Visible = true;
            cnt = 0;
           // chk();
            Invoice_Report();
            Panel1.Visible = false;
            btnchrg.Visible = true;
            btnCalc.Visible = true;

推荐答案

我没有得到
使用For循环通过In循环从动态表中读取值将所有值存储在适当的类型中
之后将其存储到数据库
I Did''t Get
Use For Loop To Read Values From Dynamic Table With In Loop Add All Values Store in appropriate type
After that Store It To Database


这篇关于如何在动态表中进行性能计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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