GridView Rowdatabound问题 [英] GridView Rowdatabound Problem

查看:104
本文介绍了GridView Rowdatabound问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我,得到ArgumentOutofRangeException



taskno = 0;

sno_number是整数列表数组



I,m getting ArgumentOutofRangeException

taskno=0;
sno_number is integer list array

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            MySqlConnection con1 = new MySqlConnection();
            con1.ConnectionString =                  ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
                con1.Open();
                
query = "select SUM(actual_activity_unit_val),total_activity_size,SUM(actual_activity_efforts),total_planed_cativity_efforts from master_list1 where task_number=" + sno_number[taskcount];
                
MySqlDataAdapter da = new MySqlDataAdapter(query, con1);
DataSet ds1 = new DataSet();
da.Fill(ds1);

e.Row.Cells[3].Text = ds1.Tables[0].Rows[0][0] + "/" + ds1.Tables[0].Rows[0][1];
e.Row.Cells[4].Text = ds1.Tables[0].Rows[0][2] + "/" + ds1.Tables[0].Rows[0][3];
con1.Close();
taskcount++;

            
            
        }

推荐答案

请检查你的整数数组。你确定吗你的整数数组是否包含任何值?
Please check your integer array.Are you sure your integer array holds any value?


这篇关于GridView Rowdatabound问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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